Repository navigation
Conversation
A login keeps the roles it had when it started, so a user whose admin role was taken away could still open the admin pages until their session ended. The URL rules that need the admin role, including security.access rules, now also check that the login's user is an administrator in Roller's database. Other roles are taken as the login carries them, since LDAP gives directory users a default role that Roller doesn't store. The Planet groups page now requires an administrator at the action level too, like the other admin pages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A login keeps the roles it had when it started. So when an administrator takes the admin role away from a user who is logged in, that user could still open the Server Admin pages until they logged out or their session ended.
/roller-ui/admin/**,/rewrite-statusand anysecurity.accessrule namingadmin) now also check that the login's user is an administrator in Roller's database, on each request. The check only narrows access: it never grants anything the login's roles didn't.users.ldap.defaultRole) that Roller doesn't store, so checkingeditorthe same way would lock them out.This doesn't end the user's session; they stay logged in with whatever other roles they have.
Tests:
AdministratorRoleTestchecks the database lookup (role taken away, user disabled, user gone).SecurityConfigTestsends a demoted admin's requests through the filter chain. Both new checks fail without the change. The full suite passes (1,032 tests), and the branch merges cleanly with #321 and #411–#416.