Tips for admin users

Hey,

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?

Thanks in advance :slightly_smiling_face: :computer:

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.

Anyway, just food for thought… hope it helps.

Best…
Mike

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.

Ohh, okay. Thanks. I think I won’t make them private because in the privacy roles you can´t do like double reference to a thing.

Unless you set up your dB in a way that is conducive to implement privacy roles where needed :slightly_smiling_face:

As an example …

if you set up a data type called “file” with a field type file and another field named owner of type user

then you can set up a privacy rule that says “this file´s owner is current user” … this will ensure that only the current user can see that file

Great, that can be a solution, thanks :slightly_smiling_face: :computer:

This topic was automatically closed after 70 days. New replies are no longer allowed.