Closed (fixed)
Project:
Group permissions
Version:
1.0.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 May 2023 at 05:41 UTC
Updated:
29 Mar 2024 at 16:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
msnassar commentedComment #3
msnassar commentedComment #4
msnassar commentedComment #5
msnassar commentedI have noticed other issues with the access to the routes and the group permission entity. I am investigating the issue. I will upload another patch when I am done.
Comment #6
msnassar commentedComment #8
msnassar commentedComment #9
msnassar commentedI have added MR to fix all issues listed above...
Comment #10
msnassar commentedComment #11
lobsterr commented@msnassar I don't like completely an approach you used to check route access, I will check it a bit later this week, I wonder if I could find a better way to handle it. Thanks as usual for your contribution
Comment #12
lobsterr commented@msnassar
1) Since group permission entity can't exist without group, there is no sense to keep global permissions, it was a mistake, when I created module in the first place
2) I don't think we need so many permissions to handle group permission entities. So, I simplified everything and I keep only one permission, which will give you access to all operations, including revisions. If there will be demand to split them I can introduce new permissions later. For now let's keep it simple
4) I dropped GroupPermissionEntityAccessCheck class since we don't need it anymore and also refactor a bit GroupPermissionHtmlRouteProvider
Please test it and I will proceed with other tickets
Comment #13
msnassar commentedHello @LOBsTerr
I agree with the first 2 points.
I wonder if the last one is the way to go. Here is why:
Here are the fatal errors:
I think we have 2 options to solve the issue:
Let my know your thoughts please.
Comment #14
msnassar commentedComment #15
lobsterr commented1. It looks like we still need custom access check, because of this ticket #3276738: Enabling per-group permissions by group type
2. Are you sure you checked the latest changes, we have group entity in every route (including revisions), and _group_permission access check works without any fatal errros.
Comment #16
lobsterr commentedAlso we can drop GroupPermissionAccessControlHandler, since it is not used.
Comment #17
lobsterr commented@msnassar
1) I have fixed some small issues not related to this ticket
2) I have removed access handler, since we are not using it
3) My idea is still to use "override group permissions" to control access to all routes related to group permissions
4) I can't see any fatal errors, because we have group entity for all group permissions related routes. I have tested.
5) For the related ticket we will introduce custom route access handler to check if group permissions are enabled or not.
Could you please check it again?
Comment #19
msnassar commented@LOBsTerr
Thanks for moving on with this issue. Here is my feedback about the latest changes and my previous comment #13
Yes, I have checked and test it the last changes. I know we have the group entity in all routes :) BUT what I have mentioned in #13 is the "group permission" entity!
See below for more info. about the fatal errors.
I wonder if this is ideal! By doing this, we lose the access check on the entity type. Meaning websites that are using a different way to create "group permission" entities for example using "rest/json api", might end up not being able to do so or might have vulnerability impact.
This is because they might end up using the "administer group permission entities" global permission. Granting this permission to all global roles that should create "group permissions" entities, will skip the permission granted in the group level. This will have a vulnerability impact. Because if they do so, unprivileged users, will then be able to create "group permissions" entities in the groups that are not suppose to do so! On the other hand, a members who should be able to create "group permissions" entities based on the permission in the group, might not be able to create entities because they do not have the global permission "administer group permission entities" granted to them!
I am still in favor of applying the entity access on the routes :) This is because of the reasons I mentioned in #13...
On the other hand, every time we need to apply new access rules to the entity, we have to apply them in the routes! Example #3276738: Enabling per-group permissions by group type
Here are the steps to reproduce:
The issue here is that, the user has access to the delete and revisions pages for a non existing "group permission" entity
!
Let my know your thoughts please.
Comment #20
lobsterr commentedok, I agree, I will update it
Comment #22
lobsterr commentedSo, I did a big refactoring you can review changes here https://git.drupalcode.org/project/group_permissions/-/merge_requests/27
1) I remove group_permission from all entity link template, because we need only group
2) I added a standard link template like (view, edit, add). No UI should be more clear to manage
3) I have added necessary controller handlers for it too
4) I updated the routes accordingly. From this moment we will not see any links or will not get any exceptions
@msnassar Could you please check it?
I will tag a release then
Comment #23
msnassar commented@LOBsTerr
I finally had the chance to review the MR. Please have a look...
Comment #24
lobsterr commentedComment #25
msnassar commented@LOBsTerr Thanks for the quick fix...
Just one has been missed... see here https://git.drupalcode.org/project/group_permissions/-/merge_requests/27...
Basically, I believe we won't need
group_permissions_menu_local_tasks_alteranymoreComment #27
lobsterr commentedbut you have deleted it already in this commit https://git.drupalcode.org/issue/group_permissions-3360880/-/commit/08f6...
I think we good to go to merge it.
Thank you for your help with this ticket
Comment #28
msnassar commented@LOBsTerr Sorry I didn't noticed that the other PR has been merged... Thanks
I wonder what is the plan for Group permission 2.0?
Comment #29
lobsterr commentedThe next step is version 2.0