Skip to main content
Topic: User Roles and Records Mgmt.  (Read 1525 times) previous topic - next topic

User Roles and Records Mgmt.

Hi all! Learning my way around PHPRad to redo an app I wrote a while back.

I have 3 user roles in my application -> User, Reviewer, Admin.
I have a table to hold "entries". Think of it as a daily journal.

Each user is assigned a reviewer (reviewer_id in the user's row of the user's table).

  • Entries should be visible to the user (only their own).
  • Reviewers should be able to see any entry where they are the reviewer (multiple users may have this person as reviewer).
  • Admins should be able to see all.

Can anyone provide any guidance in setting up the above permissions?



 

Re: User Roles and Records Mgmt.

Reply #2
Dynamic.

Re: User Roles and Records Mgmt.

Reply #3
@bgoldstein‍  add the following code to your List Page where configuration in List Page Properties.
Code: [Select]
"posted_by='". USER_ID . "' OR review_by='". REVIEWER_ID ."'"
where posted_by and review_by are fields in the table that contain the records and a similar field reviewer exists in the user table.

After that, add the following code in your /config.php file.
Code: [Select]
define('REVIEWER_ID',(isset($_SESSION[APP_ID.'user_data']) ? $_SESSION[APP_ID.'user_data']['reviewer'] : null ));