Hi there
I want to order the system users in groups - for example, 30 users are in 10 different stores/offices/etc - and we want to group them in the order of where they are:
Group1:
Group2:
Is it possible to create a custom field for the system user? For example āStore Nameā or āGroupā?
If not - is there a way this can be achieved?
Thank you,
Jorge Matias
Hi @jmatias,
You can achieve this by utilizing custom roles in the Admin app.
For example, you could create roles such as system_user_role
and store_user_role
, and then assign users to these roles accordingly.
Thanks,
Mumbi Francis
Thatās what I was thinking / but they are all āStore Assistantsā, who work in different stores
But for now, thatās what I will do - different role names with the same privileges
Thank you
JMatias
Edit: Iāll take a look into the contextual roles - Contextual Role Evaluation :: Corteza Docs
Following the Contextual Role Evaluation - can we use āresource.createdBy == userIDā and write down 2 or 3 IDs - and that role could see records created by X | Y | Z recordsā
JMatias
Can the user grouping be achieved with the API?
For example - I would create a new module, with all the stores listed (with Store name, location, etc);
Then I would make an API request on ā/api/systems/users/{userID}ā including a custom field in the payload that references the Store ID from the Stores module created first:
{
"userID": "12345",
"name": "John Doe",
"email": "john.doe@example.com",
"meta": {
"storeID": "store-abc"
}
}
Then I would compose a new View with prefilters of the āstoreIDā value of the logged-in user;
Is this possible to be achieved? I will try to - but I have some doubts about the prefilters for the views
Has someone tried this? Iāll keep this updated if I can successfully do this
JMatias