Limit Viewing Of Data Based On Role

Can the plugin restrict the viewing of particular data based on the role of the user? I am using the plugin to build a secure directory for a hospice staffing agency and there is sensitive information that cannot be available to all users of the directory. For example, certain users are only authorized to view certain data fields, while other users with a different role needs to view other data fields within the same record. Thanks as always for your help.

  • digitsoft
    • The Crimson Coder

    Not out of the box….I even thought about combining it with the Membership plugin, but to restrict certain fields and data you’ll need either:

    Membership, Directory, and custom code for the plugin


    Directory, custom roles, and custom code for the plugin

    Anyone have a better idea?

  • Arun Basil Lal
    • New Recruit

    Hello evensongprod,

    Am afraid this isn’t possible with the Directory plugin as such, but a combination of Directory and CustomPress could do this, here is how.

    CustomPress plugin:

    Using CustomPress, create custom fields for the sensitive data. When you create the listing, let the sensitive data be entered in as Custom Fields.

    Now, you can show the values on the listing page using the embed codes, but make sure that you use the capability check using the current_user_can function:

    I hope this make sense, Let me know if you have more questions. :slight_smile:

  • aecnu
    • WP Unicorn

    Greetings evensongprod,

    We have not heard back from you as to the status of this issue.

    If you are still having an issue please let us know so that we may try to get you fixed up as soon as possible by choosing to check mark this ticket as unresolved below and posting any new errors or symptoms you are noticing.

    This action will also bring your ticket up front back in plain view again within the ticket system.

    Thank you for being a WPMU Dev member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.