click here for details... Sakai Executive Director Position Search now open
Issue Details (XML | Word | Printable)

Key: KNL-130
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Anthony Whyte
Reporter: Greg Thomas
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Kernel - K1

Improvement to one of the isAllowed() functions in authz

Created: 23-Feb-2009 09:02   Updated: 05-Mar-2010 02:48
Component/s: Impl
Affects Version/s: 1.0.14
Fix Version/s: 1.0.4, 1.1.0

Time Tracking:
Not Specified

File Attachments: 1. Text File authz.patch (2 kB)

Issue Links:
Duplicate
 
Relate
 

1.0.x Status: Resolved


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits   git Commits      Sort Order: Ascending order - Click to sort in descending order
Stephen Marquard added a comment - 23-Feb-2009 09:30
Greg, to clarify, this is _only_ to resolve issues related to roleswap, i.e. when you say "this may take care of a lot more bugs that may not have been discovered yet in other tools", you mean in those tools under roleswap conditions?

Conversely, this code change will therefore not affect the behaviour of any "normal" (non-roleswap) authz calls?

Just want to be clear - as I understand it this is a bugfix to the authz changes for roleswap and doesn't (say) affect behaviour of authz in 2-5-x or non-roleswap behaviour.

Greg Thomas added a comment - 23-Feb-2009 11:35
Stephen,

That's exactly correctly, this only alters behavior when the user is in the "role swapped" state and would not alter any of the normal authz calls/checks. As far as I know, none of this is in current 2.5.x code (although IU is the only place I know where its implemented on a 2.5 based build).

Greg

Stephen Marquard added a comment - 23-Feb-2009 12:07
Thanks for the clarification. Do you have this in production yet at IU?

Greg Thomas added a comment - 23-Feb-2009 12:33
We do not have this specific change in at IU yet, but probably will next month.

Stephen Marquard added a comment - 13-Mar-2009 07:44
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.

Anthony Whyte added a comment - 25-Mar-2009 13:22
Intended for 1.0.4 release

Anthony Whyte added a comment - 27-Mar-2009 13:24
released.