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

Key: SAK-7924
Type: Task Task
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Greg Thomas
Reporter: Peter A. Knoop
Votes: 20
Watchers: 20
Operations

If you were logged in you would be able to see more operations.
Sakai

View Site as if in a Different Role

Created: 27-Jan-2006 12:17   Updated: Tuesday 02:58 PM
Component/s: Authz service (Pre-K1/2.6), Forums (Don't use) , Messages (Don't use) , Portal, Sakai-Mock, View As
Affects Version/s: 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1
Fix Version/s: 2.6.0

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

File Attachments: 1. File sak-7924-backfill.sql (4 kB)
2. Text File sak-7924-kernel.patch (17 kB)
3. Text File sak-7924-sakaiproperties.txt (0.2 kB)
4. Text File sak-7924.patch (22 kB)
5. File SV-Documentation.rtf (5 kB)

Image Attachments:

1. after.png
(103 kB)

2. before.png
(114 kB)
Issue Links:
Depend
 
Duplicate
 
Incorporate
 
Relate

2.6.x Status: None
2.5.x Status: None
2.4.x Status: None

Sub-Tasks  All   Open   

 Description  « Hide
The ability for a user to view the site as it would be viewed by a user with a different role in the site. For example, an instructor being able to view a site as their students see it.

This is similar to, but not the same as the SUTool, which allows admin users to view the site as a specific user would see it.

 All   Comments   Work Log   Change History   Subversion Commits   git Commits      Sort Order: Ascending order - Click to sort in descending order
Peter A. Knoop added a comment - 12-Jun-2006 15:37
Another use case from a Resources discussion:

An instructor wants to demo their site in class as if they were a student looking at things.

"Our instructors often want to demo their site to students live in class. They don't want hidden materials in the default view of the Resource list, even for them. A way to hide this column from the list view, even just during the session if not as a "Hide availability in list view" Option, would help. I can't imagine being an instructor on Day 1, standing up in front of class to show students what the resource area looks like with three available resources and 30 marked hidden!"

Greg Thomas added a comment - 30-Nov-2007 09:28
r38916 & r38917

First attempt at this. Separated it out to a different branch for now to get some testing from IU and make changes on it before moving it into trunk. Feedback and fixes are certainly welcomed!

Greg Thomas added a comment - 30-Nov-2007 14:00
r38924 - edit for a 2.4.x build

Greg Thomas added a comment - 06-Dec-2007 15:50
2.4.x version:

authz - r38992
portal - r38993
site - r38994

trunk version:

site - r39014
portal - r39015
authz - r39016

Peter A. Knoop added a comment - 01-Feb-2008 08:56
Greg, is there a design or spec that you could post here to describe this new feature and give folks an idea of how it works? Thanks.

Greg Thomas added a comment - 07-Feb-2008 13:00
View of before a user selects a role. All roles available in the site (except the user's current role) are displayed in the dropdown.

Greg Thomas added a comment - 07-Feb-2008 13:00
View of the page after a different role has been selected.

Greg Thomas added a comment - 07-Feb-2008 13:04
A new permission, "site.roleswap", is set for particular roles in any given site. The permission will determine if the role swapping capability is to display on the site.

Assuming the permission is set for the user's role for a site, a drop down menu with all the roles available in the site (except the user's current role) will display in the upper right. The user simply picks which role they wish to switch to. The user will be taken right back to the tool/page they were in with an updated display of what the page looks like to the role selected. This state will remain for other tools in the site, as well. There will be a hyperlink saying "Exit Role Swap View" where the drop down menu was prior. The user clicks on the link to return to their normal role and the page display will return to what it should normally be for the user. Should be noted that since the variable is unique, the state will not cross over to other sites a user may be part of.

In the background, after a user selects a different role, a unique variable is set in the session that will be checked on frequently in the authz tool, especially the "isAllowed()" functions. If this variable is found in authz, a different query is ran against the database to make sure the permission is exists in a site and return the appropriate true/false answer on the function. When the user exits the role swap view, logs out, or closes the browser, the session variable is deleted and will be back to a normal state.

Greg Thomas added a comment - 25-Feb-2008 10:46
The branches were updated to get the newer versions of the various trunk codes. Committed some more updates based on that.

authz - r41596
portal - r41597
site - r41598
sakai-mock - r41599

Greg Thomas added a comment - 27-Feb-2008 08:55
authz - r41665

Greg Thomas added a comment - 18-Apr-2008 09:36
Update on this:

The roles that can be switched to with this tool are now defined in sakai.properties so institutions can set them to whatever they want them to be (e.g. studentview.roles=Student,access ). This is not to be confused with roles that have permission to use the role switching mechanism. The UI will know if there's multiple roles for the site and will display a dropdown for the user to select which role to switch to or if its only 1 role, it'll be a standard anchor link.

Because of that change, that also makes the security a bit tighter and various checks are made throughout the code for sanity purposes. This helps ensure the system gets legit requests that an institution wants to allow.

Additionally, the caching is much more efficient now in the authz tool, so it should increase performance.

Greg Thomas added a comment - 22-Sep-2008 08:57
Attached 2 patch files, 1 for the kernel part for 2.6 and the other for the rest of the code.

Also attached the change to put in sakai.properties as well as the backfill sql.

Note on the backfill that you'll need to edit it first depending if you're doing mysql or oracle.

Ian Boston added a comment - 26-Sep-2008 11:09
Some comments.

The Kernel Patch is Ok.

Can you confirm that there is an audit event when an a role is switched.

Where is a UI to switch roles ?

Is it on or off by default ?

Greg Thomas added a comment - 26-Sep-2008 11:54
I guess it isn't clear in the comments, so I'll try to clarify it better. :)

1. Run the SQL script (edit it first to uncomment and pick for mysql or oracle). The site.roleswap permission is given to Instructor for course and project sites by default.
2. Edit your sakai.properties and add in the content from the attached file (sak-7924-sakaiproperties.txt). Defaults are set to Student, Teaching Assistant, and access.
3. Apply both patches to your instance.

If those all all done, you should be good to go.

It is on by default. If the user has the site.roleswap permission and a role from the sakai.properties is found in the site, then something (link or dropdown) will render in the UI in the upper-right part of the screen. I guess you can easily turn this feature off on the site just by simply not having anything defined in the sakai.properties or having nothing with the site.roleswap permission.

From the UI and assuming you have the permission, there will either be a link that says "Enter (role name) view" or a dropdown with "View Site as: (dropdown with available roles)". After clicking the link or picking something from the drop down, the link will say "Exit (role name) view". Additionally, the tool that you are in will be reloaded onto the 'home page' of that tool and refreshed into whatever role you picked. You'll stay in this role throughout the site until you either logoff or click the exit link.

This event is tracked through variables in the session (which can be viewed in the portal section of the code). Its the key for triggering permission checks to check as a different role for what the user should be. This ensures the "swapped state" is only for a particular site for the user and can easily expire just from closing the browser and preventing any sort of weirdness the next time the user logs in.

Hopefully this will make it more clear. Feel free to edit the various roles to try out different combinations. Its suppose to be flexible in that regard.

Peter A. Knoop added a comment - 29-Sep-2008 07:22
[Bulk Comment] This Task (or Sub-Task) issue currently is Unresolved, but has a Fix Version of 2.6. The Code Freeze for Sakai 2.6 has now passed (29-Sep-2008, 8:00am Eastern US time).

If you are still working to resolve this issue for 2.6, then please post an email to sakai-dev to let everyone now that you need an exception for this JIra, explain what is left to do, and when you plan to have the work completed; please include that information here in the Jira as well.

Otherwise, if the resolution of this task has been postponed, please reset the Fix Version to 2.7 or Unknown, depending on what you're new expectations for completion are. If the issue is no longer relevant, please close the issue as Won't Fix or Incomplete with an explanation of why.

Thanks!

Greg Thomas added a comment - 01-Oct-2008 07:20
This should be resolved now with all the code in the trunk build. Just need to make sure it gets properly cut into 2.6.

Joshua Baron added a comment - 15-Dec-2008 09:57
Just checking in to see what the status if for this getting into the 2.6 release. Major issue for faculty here at Marist so we're hoping it makes it! Thanks for the effort on this one!

Stephen Marquard added a comment - 15-Dec-2008 11:15
This will be in 2.6. There are a couple of related issues that have surfaced (see the linked issues above), but nothing too severe.

Joshua Baron added a comment - 02-Mar-2009 11:16
Just looking for confirmation at this is in 2.6???

We're starting our transition planning.

Stephen Marquard added a comment - 02-Mar-2009 11:19
This is in 2.6.

Hannah Reeves added a comment - 02-Feb-2010 11:03
It appears that users in the admin role (e.g. who are members of the Admin workspace) cannot see this change in UI. Does anyone know if there is a way to enable this or was this by design?

Stephen Marquard added a comment - 02-Feb-2010 11:37
Currently, it's "by design" (though not optimal) because for admin users, all authorization checks are bypassed, so "student view" doesn't have any effect. To see it, you have to login as a regular user.