In my app, I need to have admin users with different admin roles (admin_1, admin_2, admin_3). Each role of admin has restrictions (exept admin_1). Admin users will be able to change fields (name, last_name, etc…) for every user (exept admins).
How can I name a user admin? With an “admin” field?
What is the correct/best way to have admin users?
Are privacy roles are a thing in this topic?
Any tips on how to achieve this?
Hi there, @hacker… others may disagree, of course, but I don’t think there is a correct/best way to have admin users… it’s all about what works best for your app. That being said, when I need functionality that is similar to what you have described, I almost always go with a role field in the User data type, and I tie that field to an option set that defines the roles. With that setup in place, it’s easy to add new roles at any time, and it’s also pretty easy to control functionality with conditionals that key off of a user’s role.
Ohh, I hadn’t thought of doing it with option sets, great idea. Thanks.
One more question, normal users need to add an ID card, and admin users can verify normal users if their ID card is valid. The ID card has sensitive information and it wouyld be better if its a private file.
How can I make that only the admin users and a normal user can see this user´s ID card?
I’m not an expert on file-related stuff, but there is a checkbox to make a file private when it is uploaded, and you have to attach a private file to something, which in your case would be the current user, I assume. At that point, I believe you could put a privacy rule in place that allows only the current user or a user with a role of admin to view a user’s attached files.