Page 1 of 2

User Role permission

Posted: 07 Mar 2022, 14:14
by facciolini
Good morning everyone,
how to give "Manager" role user permission to view and edit:
- entityes templates
- public forms
- modules "users alerts"

Thanks to those who can help me

Re: User Role permission

Posted: 09 Mar 2022, 10:00
by support
There is no configuration for this. Only admin can configure these things.

Re: User Role permission

Posted: 09 Mar 2022, 16:21
by Paullm
Not needed in my particular situation, but I could see the merit in having this capability ... but as part of a "Developer" role; not "Manager".

It's probably far too complex to retro-fit, but it would be very flexible to have the various Administration functions accessible by role. Therefore, a "Developer" is able to make SOME system changes and a "Manager" able to add/manage "Users".

Re: User Role permission

Posted: 09 Mar 2022, 20:48
by facciolini
Yess Paullm
it would really be very useful, especially when developing for a client.
Sergey if it were possible, I would make a donation

Re: User Role permission

Posted: 09 Mar 2022, 22:23
by techtr
I was thinking more like a "Super Admin" and one or several Admin's as developers.

Re: User Role permission

Posted: 09 Mar 2022, 22:31
by Paullm
If admin functions were assignable to roles, every Ruko instance could be configured as desired ... the highest level administrative function, of course, being "God". :roll:

Re: User Role permission

Posted: 09 Mar 2022, 23:16
by nruslan2

Re: User Role permission

Posted: 10 Mar 2022, 10:56
by facciolini
Hi nruslan2,
I prefer the official Ruko extension, for the stability of the structure, especially for such a delicate thing, linked to privacy ... Thanks for the proposal

Re: User Role permission

Posted: 10 Mar 2022, 11:50
by Paullm
I agree. Also, paid-improvement #113 appears to only relate to Global Lists; not each administrative function.

Re: User Role permission

Posted: 10 Mar 2022, 14:24
by pepe
Hi,
STEP 1: you could use the sort order field in User Access groups to setup a hierarchy. For example:
- 100 = supper admin
- 90 = site admin
- 80 = management
- 70 = project manager
- 60 = client
- and so on ...

STEP 2: in entity Users, create a field of type MySQL Query to store that store the related hierarchical level value with the user:
CASE
WHEN [6]=0 THEN 100
ELSE (SELECT app_access_groups.sort_order FROM app_access_groups WHERE app_access_groups.id=[6] LIMIT 1)
END

You need to take care of super admin. Super admin does not have entry in table for User Access Groups. Now, you could use the access level values in various entities for permitting edit, view, hide fields, etc.

STEP 3: Push the $app_user array -> JS using code like this:
<script type='text/javascript'>
<?php
$varPHP = array('abc','def','ghi');
$jsonPHP = json_encode($varPHP);
echo "var varJS= ". $jsonPHP . ";\n";
?>
</script>
This has been posted before @ viewtopic.php?f=2&t=2068&p=9034&hilit=app_user#p9034
Then you can use this information in forms to monitor user access.

Hope this is of some help.
Regards, Pepe