I have a use case where I am looking for possible options to attach a member to inherit the permissions of multiple groups. Is this something that can be done with AG?
Tony
Attaching a member to multiple groups
Re: Attaching a member to multiple groups
You can use individual permission for that member instead.
Re: Attaching a member to multiple groups
In small businesses, multiple roles are often assigned to the same individual, and in such cases it makes perfect sense to want what Tony is describing.
For example, suppose you have an Administration Executive and an HR Executive, each belonging to their respective member groups. The organization then hires a Senior Executive who will handle both Admin and HR tasks when needed, and also oversee daily operations. Similarly, a Manager might need access across Administration + HR + IT. Instead of creating new hybrid groups or manually assigning individual permissions every time, the ability for a single member to inherit permissions from multiple existing groups would solve the problem cleanly by creating:
- Administration Group for Admin. Executive
- HR Group for HR Executive
- IT Group for IT Officer
- Senior Executive the groups for Admin + HR
- Manager the groups for Admin + HR + IT
- Active Directory: A user can belong to multiple security groups, and their effective permissions are the union of all groups. This is one of the most widely used RBAC models in the world.
- Epicor ERP: Users can belong to multiple security groups, each granting different menu/process permissions. Effective access is the sum of all assigned groups.
- Oracle ERP Cloud / Oracle Fusion: Users can be assigned multiple job roles, abstract roles, and duty roles. Oracle’s RBAC model is explicitly multi‑role, and permissions are additive.
- ERPNext: Users can have multiple roles at the same time (e.g., HR User + Accounts User + Projects User). Permissions from all assigned roles are combined.
-Saymaad
Re: Attaching a member to multiple groups
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Attaching a member to multiple groups
I absolutely agree with all of you.
As of today, user permissions could solve this requirement, if just handling was easy enough.
Now, this is a many-years-old topic, and if I remember right, one of my very first forum posts (many years ago) was about this. In the past I've started building a helper for my purposes. I don't have a UI, but let me show my implementation which makes it easy, even for non-professional coders, to assign member(s) to multiple groups:
Code sample with some comments
That's it. My code gathers and merges the selected groups' permissions and applies them to the selected users.
Result
This is from user-specific permissions (not group-permissions):
Challenge
The biggest challenge is about mismatching group-permissions:
Imagine
Now, in these cases I've decided to allow
Some may have a different opinion about this. But, actually, it would be easy to implement it vice-versa (more restrictive).
There is a small helper-routine for removing all user-specific records:
Remarks
As mentioned above, this is pure PHP code, no UI, yet. If there is interest I could add a user interface (UI), for example as custom page. If you are interested, please contact me directly.
Any comments?
You may check the additional screenshots below...
As of today, user permissions could solve this requirement, if just handling was easy enough.
Now, this is a many-years-old topic, and if I remember right, one of my very first forum posts (many years ago) was about this. In the past I've started building a helper for my purposes. I don't have a UI, but let me show my implementation which makes it easy, even for non-professional coders, to assign member(s) to multiple groups:
Code sample with some comments
Code: Select all
$helper = new \Helper\MultiGroupMembership\Configurator();
// find (multiple) groups by name
$groups = $helper->findGroups('test', 'Gruppe 1a Sachbearbeiter');
// find (multiple) users by memberID
$members = $helper->findMembers('test', 'user 1');
// assign members to selected groups
$success = $helper->assign($members)->to($groups);
Result
This is from user-specific permissions (not group-permissions):
Challenge
The biggest challenge is about mismatching group-permissions:
Imagine
group1 is allowed to insert into table1 but group2 is not. It's even more complicated with view, edit and delete permissions which can be None, User, Groupor All.Now, in these cases I've decided to allow
insert if at least one group it allowed to. Similar for the others: If one of user's groups is allowed to edit all, the user should be allowed to edit all. Some may have a different opinion about this. But, actually, it would be easy to implement it vice-versa (more restrictive).
There is a small helper-routine for removing all user-specific records:
Code: Select all
$all_members = $helper->getMembers();
$confirm_delete = true;
$helper->reset($all_members, $confirm_delete);
As mentioned above, this is pure PHP code, no UI, yet. If there is interest I could add a user interface (UI), for example as custom page. If you are interested, please contact me directly.
Any comments?
You may check the additional screenshots below...
- Attachments
-
- Some more code
- Code_TmrGvTAP2u.png (45.73 KiB) Viewed 2919 times
-
- List of Groups
- chrome_TQ0GNsxG7v.png (2.65 KiB) Viewed 2919 times
-
- List of Members
- chrome_MWByUf01yP.png (4.53 KiB) Viewed 2919 times
Kind regards,
Jan
AppGini 26.12 + all AppGini Helper tools
My Side Project
www.office-app.com | Coding Sample | Changelog | Blog | Top 20 Features
Integrated Statemachine Workflow • KANBAN • Audit Trail • Integrated API • Model Driven • Field-Level permission • Modern UI
My Company Website
www.bizzworxx.de
My AppGini Blog
appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
Jan
<js /> AppGini 26.12 + all AppGini Helper tools
My Side Project
www.office-app.com | Coding Sample | Changelog | Blog | Top 20 Features
Integrated Statemachine Workflow • KANBAN • Audit Trail • Integrated API • Model Driven • Field-Level permission • Modern UI
My Company Website
www.bizzworxx.de
My AppGini Blog
appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code] blocks for better readability
