Improvement to one of the isAllowed() functions in authz

Description

While working on a different alternate role viewing bug, some code that existed in the kernel's authz code was reexamined and modified. The basic rundown was the previous code in the isAllowed(String, String, Collection) function located in the DbAuthzGroupService.java file, only checked the base site id (e.g. /site/sideId ) for permissions on the role instead of all of the realms that were passed into the Collection, which the normal use case does in a big nested SQL statement. This caused the Podcast bug linked to this jira to not work 100% correctly since the key realm to check was something like: /content/group/siteId/Podcasts/ .

So this new approach will make sure every realm passed into this function will get checked for permissions in the role that's being requested. It is also prioritized to check the /site/siteId realm first since that is where a true return will happen a vast majority of the time.

Not only does it fix the linked bug, but this may take care of a lot more bugs that may not have been discovered yet in other tools, since the scope of the feature is potentially any tool that exists in sakai and switching to a different role with countless number of permission/configuration scenarios.

The code was reviewed with colleagues at Indiana University and implemented some suggested changes. I'm presenting this to the community now to try to get it into the 2.6 release since I think it is a critical improvement/bug fix.

Environment

None

Test Plan

None

Attachments

1

Activity

Anthony Whyte March 27, 2009 at 1:24 PM

released.

Anthony Whyte March 25, 2009 at 1:22 PM

Intended for 1.0.4 release

Stephen Marquard March 13, 2009 at 7:44 AM

Applied patch in r58599.

Anthony, please could you update the maven repo with a new 1.1-SNAPSHOT, so this can be verified on nightly2.

Gregory Thomas February 23, 2009 at 12:33 PM

We do not have this specific change in at IU yet, but probably will next month.

Stephen Marquard February 23, 2009 at 12:07 PM

Thanks for the clarification. Do you have this in production yet at IU?

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created February 23, 2009 at 9:02 AM
Updated April 25, 2018 at 3:34 PM
Resolved March 13, 2009 at 7:44 AM