-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework plugin to use auth_aclcheck() #7
base: master
Are you sure you want to change the base?
Conversation
This replaces the code for checking the ACL rules by calls to the existing auth_aclcheck() function. This avoids the duplication of ACL evaluation logic and allows to use this plugin with ACL extenstion plugins like aclregex or aclplusregex. The new logic goes through all the users and groups that are contained in the ACL rules and checks the permissions for these subjects. If the permissions for the subject exceed those of the 'ALL' group, they are added to the list. Signed-off-by: Frieder Schrempf <[email protected]>
@splitbrain @annda Could you spare a moment to look at this PR? Thanks! |
I added another commit to this, that moves most of the code to helper functions. This allows integration in other plugins or templates. See cosmocode/dokuwiki-template-sprintdoc#75 for a use-case (integration in sprintdoc template). |
This allows us to reuse the code in other plugins or templates. Signed-off-by: Frieder Schrempf <[email protected]>
@splitbrain @annda Any chance to get this reviewed and merged? I've been successfully using this on a production instance for a couple of weeks now. But my PHP skills are not great, so I can't really tell if there might be performance issues in cases where there are a lot of ACL rules. |
Hmm let me see if I understand the code correctly. You loop over all ACL entries and extract the user or group from it. Then you do a call to auth_aclcheck with the current page and the found user and group? The latter will do a loop over the ACLs again. Yeah I fear this will have really bad performance on large ACL setups. |
Thanks for looking at the proposal. I admit the solution is not great and a quick check shows that performance is indeed worse than before. Instead of looping over all ACL rules, we could also loop over all existing users and probe the permissions for each one, but that leads to the same performance issues. I think a proper solution would be rewriting What do you think? |
This replaces the code for checking the ACL rules by calls to the existing
auth_aclcheck()
function. This avoids the duplication of ACL evaluation logic and allows to use this plugin with ACL extension plugins likeaclregex
oraclplusregex
.The new logic goes through all the users and groups that are contained in the ACL rules and checks the permissions for these subjects. If the permissions for the subject exceed those of the
ALL
group, they are added to the list.