[DS-309] Shiboleth default roles are applied also to anonymous user and user logged-in with other methods

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4308 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Andrea Bollini
2009-09-30 19:01:21 +00:00
parent 40559cdfd1
commit 316408bb47
3 changed files with 26 additions and 17 deletions

View File

@@ -203,6 +203,8 @@ public class ShibAuthentication implements AuthenticationMethod
{
// the person exists, just return ok
context.setCurrentUser(eperson);
request.getSession().setAttribute("shib.authenticated",
new Boolean("true"));
}
return AuthenticationMethod.SUCCESS;
@@ -215,7 +217,13 @@ public class ShibAuthentication implements AuthenticationMethod
*/
public int[] getSpecialGroups(Context context, HttpServletRequest request)
{
// no user logged in or user not logged from shibboleth
if (context.getCurrentUser() == null
|| request.getSession().getAttribute("shib.authenticated") == null)
{
return new int[0];
}
if (request.getSession().getAttribute("shib.specialgroup") != null)
{
return (int[]) request.getSession().getAttribute(