Question
Is there any best practice for setting up Create - Read - Update - Delete permission for different user types?
Background
I’m building a company resource management app. The simple version contains 2 types of user role: admin and employee , each employee will have a profile
- Admin can have full CRUD permission to profile
- Employee can only see their own profile
What I have done until now
- Use Database privacy to control who can Read what
Current user's role is Admin
Current user's role is Employee AND This Profile's Employee is Current user's Employee
- Use conditionals in elements to limit the ability to Create, Update or Delete a data thing
-
If Current User's Role is not Admin
->This element isn't clickable
-
Right now I only have 2 types of user so it’s easy to set the conditions, in the future I want to add more user type with more complicated permissions (e.g. a manager can update but cannot delete profiles, a HR employee can on create, read, update the profile belong to their department…), so using conditions to control the C,U,D doesn’t seem to be the best way since I have to set it in multiple elements