com.liferay.portal.security.permission
Class AdvancedPermissionChecker

java.lang.Object
  extended by com.liferay.portal.security.permission.BasePermissionChecker
      extended by com.liferay.portal.security.permission.AdvancedPermissionChecker
All Implemented Interfaces:
com.liferay.portal.security.permission.PermissionChecker

public class AdvancedPermissionChecker
extends BasePermissionChecker

View Source

Author:
Charles May, Brian Wing Shun Chan, Raymond Augé

Field Summary
protected  java.util.Map<java.lang.Long,java.lang.Boolean> companyAdmins
           
protected static java.lang.String RESULTS_SEPARATOR
           
 
Fields inherited from class com.liferay.portal.security.permission.BasePermissionChecker
checkGuest, defaultUserId, omniadmin, ownerRole, signedIn, user
 
Constructor Summary
AdvancedPermissionChecker()
           
 
Method Summary
protected  long[] getResourceIds(long companyId, long groupId, java.lang.String name, java.lang.String primKey, java.lang.String actionId)
           
protected  com.liferay.portal.security.permission.PermissionCheckerBag getUserBag(long userId, long groupId)
           
protected  java.util.List<com.liferay.portal.model.Organization> getUserOrgs(long userId)
           
protected  boolean hasGuestPermission(long groupId, java.lang.String name, java.lang.String primKey, java.lang.String actionId)
           
 boolean hasOwnerPermission(long companyId, java.lang.String name, java.lang.String primKey, long ownerId, java.lang.String actionId)
           
 boolean hasPermission(long groupId, java.lang.String name, java.lang.String primKey, java.lang.String actionId)
           
protected  boolean hasPermissionImpl(long groupId, java.lang.String name, java.lang.String primKey, java.lang.String actionId)
           
 boolean hasUserPermission(long groupId, java.lang.String name, java.lang.String primKey, java.lang.String actionId, boolean checkAdmin)
           
protected  boolean hasUserPermissionImpl(long groupId, java.lang.String name, java.lang.String primKey, java.lang.String actionId, boolean checkAdmin)
           
 boolean isCommunityAdmin(long groupId)
           
protected  boolean isCommunityAdminImpl(long groupId)
           
 boolean isCommunityOwner(long groupId)
           
protected  boolean isCommunityOwnerImpl(long groupId)
           
 boolean isCompanyAdmin()
           
 boolean isCompanyAdmin(long companyId)
           
protected  boolean isCompanyAdminImpl()
           
protected  boolean isCompanyAdminImpl(long companyId)
           
protected  void logHasUserPermission(long groupId, java.lang.String name, java.lang.String primKey, java.lang.String actionId, org.apache.commons.lang.time.StopWatch stopWatch, int block)
           
 
Methods inherited from class com.liferay.portal.security.permission.BasePermissionChecker
getCompanyId, getOwnerRoleId, getUserId, hasOwnerPermission, hasPermission, init, isOmniadmin, resetValues, setCheckGuest, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESULTS_SEPARATOR

protected static final java.lang.String RESULTS_SEPARATOR
See Also:
Constant Field Values

companyAdmins

protected java.util.Map<java.lang.Long,java.lang.Boolean> companyAdmins
Constructor Detail

AdvancedPermissionChecker

public AdvancedPermissionChecker()
Method Detail

hasOwnerPermission

public boolean hasOwnerPermission(long companyId,
                                  java.lang.String name,
                                  java.lang.String primKey,
                                  long ownerId,
                                  java.lang.String actionId)

hasPermission

public boolean hasPermission(long groupId,
                             java.lang.String name,
                             java.lang.String primKey,
                             java.lang.String actionId)

hasUserPermission

public boolean hasUserPermission(long groupId,
                                 java.lang.String name,
                                 java.lang.String primKey,
                                 java.lang.String actionId,
                                 boolean checkAdmin)

isCommunityAdmin

public boolean isCommunityAdmin(long groupId)

isCommunityOwner

public boolean isCommunityOwner(long groupId)

isCompanyAdmin

public boolean isCompanyAdmin()

isCompanyAdmin

public boolean isCompanyAdmin(long companyId)

getResourceIds

protected long[] getResourceIds(long companyId,
                                long groupId,
                                java.lang.String name,
                                java.lang.String primKey,
                                java.lang.String actionId)
                         throws java.lang.Exception
Throws:
java.lang.Exception

getUserBag

protected com.liferay.portal.security.permission.PermissionCheckerBag getUserBag(long userId,
                                                                                 long groupId)
                                                                          throws java.lang.Exception
Throws:
java.lang.Exception

getUserOrgs

protected java.util.List<com.liferay.portal.model.Organization> getUserOrgs(long userId)
                                                                     throws java.lang.Exception
Throws:
java.lang.Exception

hasGuestPermission

protected boolean hasGuestPermission(long groupId,
                                     java.lang.String name,
                                     java.lang.String primKey,
                                     java.lang.String actionId)
                              throws java.lang.Exception
Throws:
java.lang.Exception

hasPermissionImpl

protected boolean hasPermissionImpl(long groupId,
                                    java.lang.String name,
                                    java.lang.String primKey,
                                    java.lang.String actionId)

hasUserPermissionImpl

protected boolean hasUserPermissionImpl(long groupId,
                                        java.lang.String name,
                                        java.lang.String primKey,
                                        java.lang.String actionId,
                                        boolean checkAdmin)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

isCompanyAdminImpl

protected boolean isCompanyAdminImpl()
                              throws java.lang.Exception
Throws:
java.lang.Exception

isCompanyAdminImpl

protected boolean isCompanyAdminImpl(long companyId)
                              throws java.lang.Exception
Throws:
java.lang.Exception

isCommunityAdminImpl

protected boolean isCommunityAdminImpl(long groupId)
                                throws java.lang.Exception
Throws:
java.lang.Exception

isCommunityOwnerImpl

protected boolean isCommunityOwnerImpl(long groupId)
                                throws java.lang.Exception
Throws:
java.lang.Exception

logHasUserPermission

protected void logHasUserPermission(long groupId,
                                    java.lang.String name,
                                    java.lang.String primKey,
                                    java.lang.String actionId,
                                    org.apache.commons.lang.time.StopWatch stopWatch,
                                    int block)