CustomPress and Membership 2 Integration

Hi guys,

I hope everyone's doing great!

I was dabbling with BuddyPress xProfile and realized that the way it stores data will not be scalable for my project. Hence, I decided to look into CustomPress as an alternative.

I will have 2 different user types. Doctors and patients. Each patient (doctors too since they're patients as well) will have their own record. I don't think xProfile will be a good idea since there will be easily more than 20 types of custom fields needed. Also, capabilities are as follows:

Doctors - can VIEW + EDIT patient records
Patients - can VIEW only their OWN records, cannot EDIT

So, my idea is to use a Custom Post Type called records to store this information. However, my questions are below:

1. How do assign a single post (record) to a single patient in such where they will be able to view them and doctors will be able to edit them (they will of course have to search for the profile based on query of details such as full name or ID)? I was thinking maybe a page after activation which will take them through a custom post creation process? Or maybe an empty custom post automatically created upon signup which auto fills their name + ID into it?

2. How do I restrict an individual record access to ONE specific user and ALL doctors?

Thank you for your time, guys. The support on this forum is amazing :slight_smile:

Warmest Regards,
Daniel Khong

  • Bojan Radonic

    Hey there Daniel Khong,

    How are you doing today?

    This should definitely be possible to do with CustomPress and by creating custom post type.

    CustomPress does have capabilities that you can assign to each role in the "Assign Capabilities" section for this specific custom post type. You can either use default user roles such as Author that has access to only his own posts, he can create/edit/delete them. Editor on the other hand would have access to edit all posts. You can even use plugins such as User Role Editor to create new user roles with special capabilities. You can find more info about user role capabilities here.

    This wouldn't help with Authors not being able to see other author posts so please also check this guide on how to make users see only their own posts http://www.wpbeginner.com/plugins/how-to-limit-authors-to-their-own-posts-in-wordpress-admin/.

    In regards to post creation you can manually assign posts to specific Authors but for your scenario I'd suggest having some sort of front end publishing for this custom post type and redirecting your users to "Create a Record" page upon registration where they will be able to create their own record if that makes sense.

    Hope this helps a bit and good luck with your project :slight_smile:

    Cheers,
    Bojan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.