Author: mwringe
Date: 2011-10-05 17:09:30 -0400 (Wed, 05 Oct 2011)
New Revision: 7674
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/GroupManagement.java
Log:
GTNPORTAL-2153: need to consider the situation where there is no logged in user. In this
case, we should return false when calling the isAdministrator method.
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/GroupManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/GroupManagement.java 2011-10-05
16:28:08 UTC (rev 7673)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/GroupManagement.java 2011-10-05
21:09:30 UTC (rev 7674)
@@ -146,9 +146,20 @@
{
if (username == null)
username =
org.exoplatform.portal.webui.util.Util.getPortalRequestContext().getRemoteUser();
- if (username.equals(getUserACL().getSuperUser()))
+
+ //if getRemoteUser() returns null, then there isn't a logged in user, which
means they are not an admin
+ if (username == null)
+ {
+ return false;
+ }
+ else if (username.equals(getUserACL().getSuperUser()))
+ {
return true;
- return isMemberOfGroup(username, getUserACL().getAdminGroups());
+ }
+ else
+ {
+ return isMemberOfGroup(username, getUserACL().getAdminGroups());
+ }
}
// public static boolean isSuperUser(String username) throws Exception {
Show replies by date