Liferay 6.1.2-ce-ga3

com.liferay.portal.security.permission
Class BasePermissionChecker

java.lang.Object
  extended by com.liferay.portal.security.permission.BasePermissionChecker
All Implemented Interfaces:
PermissionChecker, Cloneable
Direct Known Subclasses:
AdvancedPermissionChecker, SimplePermissionChecker

public abstract class BasePermissionChecker
extends Object
implements PermissionChecker


Field Summary
protected  boolean checkGuest
           
protected  long defaultUserId
           
protected  Boolean omniadmin
           
protected  Role ownerRole
           
protected  boolean signedIn
           
protected  User user
           
 
Fields inherited from interface com.liferay.portal.security.permission.PermissionChecker
DEFAULT_ROLE_IDS
 
Constructor Summary
BasePermissionChecker()
           
 
Method Summary
abstract  PermissionChecker clone()
           
 long getCompanyId()
          Returns the primary key of the user's company.
 List<Long> getGuestResourceBlockIds(long companyId, long groupId, String name, String actionId)
           
 List<Long> getOwnerResourceBlockIds(long companyId, long groupId, String name, String actionId)
           
 long getOwnerRoleId()
          Returns the primary key of the owner role.
 List<Long> getResourceBlockIds(long companyId, long groupId, long userId, String name, String actionId)
           
 long[] getRoleIds(long userId, long groupId)
          Returns the primary keys of the roles the user has within the group.
 long getUserId()
          Returns the primary key of the user.
 boolean hasOwnerPermission(long companyId, String name, long primKey, long ownerId, String actionId)
          Returns true if the user is the owner of the resource and has permission to perform the action.
 boolean hasPermission(long groupId, String name, long primKey, String actionId)
          Returns true if the user has permission to perform the action on the resource.
 void init(User user)
          Initializes this permission checker.
 boolean isCheckGuest()
          Returns true if guest permissions will be used in permission checks.
 boolean isCommunityAdmin(long groupId)
          Deprecated. As of 6.1.0, renamed to PermissionChecker.isGroupAdmin(long)
 boolean isCommunityOwner(long groupId)
          Deprecated. As of 6.1.0, renamed to PermissionChecker.isGroupOwner(long)
 boolean isOmniadmin()
          Returns true if the user is a universal administrator.
 boolean isSignedIn()
          Returns true if the user is signed in.
 void resetValues()
           
 void setValues(PortletRequest portletRequest)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.liferay.portal.security.permission.PermissionChecker
hasOwnerPermission, hasPermission, hasUserPermission, isCompanyAdmin, isCompanyAdmin, isGroupAdmin, isGroupMember, isGroupOwner, isOrganizationAdmin, isOrganizationOwner
 

Field Detail

checkGuest

protected boolean checkGuest

defaultUserId

protected long defaultUserId

omniadmin

protected Boolean omniadmin

ownerRole

protected Role ownerRole

signedIn

protected boolean signedIn

user

protected User user
Constructor Detail

BasePermissionChecker

public BasePermissionChecker()
Method Detail

clone

public abstract PermissionChecker clone()
Specified by:
clone in interface PermissionChecker
Overrides:
clone in class Object

getCompanyId

public long getCompanyId()
Description copied from interface: PermissionChecker
Returns the primary key of the user's company.

Specified by:
getCompanyId in interface PermissionChecker
Returns:
the primary key of the user's company

getGuestResourceBlockIds

public List<Long> getGuestResourceBlockIds(long companyId,
                                           long groupId,
                                           String name,
                                           String actionId)
Specified by:
getGuestResourceBlockIds in interface PermissionChecker

getOwnerResourceBlockIds

public List<Long> getOwnerResourceBlockIds(long companyId,
                                           long groupId,
                                           String name,
                                           String actionId)
Specified by:
getOwnerResourceBlockIds in interface PermissionChecker

getOwnerRoleId

public long getOwnerRoleId()
Description copied from interface: PermissionChecker
Returns the primary key of the owner role. This role is automatically given to the creator of a resource.

Specified by:
getOwnerRoleId in interface PermissionChecker
Returns:
the primary key of the owner role

getResourceBlockIds

public List<Long> getResourceBlockIds(long companyId,
                                      long groupId,
                                      long userId,
                                      String name,
                                      String actionId)
Specified by:
getResourceBlockIds in interface PermissionChecker

getRoleIds

public long[] getRoleIds(long userId,
                         long groupId)
Description copied from interface: PermissionChecker
Returns the primary keys of the roles the user has within the group.

Specified by:
getRoleIds in interface PermissionChecker
Parameters:
userId - the primary key of the user
groupId - the primary key of the group
Returns:
the primary keys of the roles the user has within the group

getUserId

public long getUserId()
Description copied from interface: PermissionChecker
Returns the primary key of the user.

Specified by:
getUserId in interface PermissionChecker
Returns:
the primary key of the user

hasOwnerPermission

public boolean hasOwnerPermission(long companyId,
                                  String name,
                                  long primKey,
                                  long ownerId,
                                  String actionId)
Description copied from interface: PermissionChecker
Returns true if the user is the owner of the resource and has permission to perform the action.

Specified by:
hasOwnerPermission in interface PermissionChecker
Parameters:
companyId - the primary key of the user's company
name - the resource's name, which can be either a class name or a portlet ID
primKey - the primary key of the resource
ownerId - the primary key of the resource's owner
actionId - the action ID
Returns:
true if the user is the owner of the resource and has permission to perform the action; false otherwise

hasPermission

public boolean hasPermission(long groupId,
                             String name,
                             long primKey,
                             String actionId)
Description copied from interface: PermissionChecker
Returns true if the user has permission to perform the action on the resource.

Specified by:
hasPermission in interface PermissionChecker
Parameters:
groupId - the primary key of the group containing the resource
name - the resource's name, which can be either a class name or a portlet ID
primKey - the primary key of the resource
actionId - the action ID
Returns:
true if the user has permission to perform the action on the resource; false otherwise

init

public void init(User user)
Description copied from interface: PermissionChecker
Initializes this permission checker.

Specified by:
init in interface PermissionChecker
Parameters:
user - the current user

isCheckGuest

public boolean isCheckGuest()
Description copied from interface: PermissionChecker
Returns true if guest permissions will be used in permission checks.

Specified by:
isCheckGuest in interface PermissionChecker
Returns:
true if guest permissions will be used in permission checks; false otherwise

isCommunityAdmin

public boolean isCommunityAdmin(long groupId)
Deprecated. As of 6.1.0, renamed to PermissionChecker.isGroupAdmin(long)

Specified by:
isCommunityAdmin in interface PermissionChecker

isCommunityOwner

public boolean isCommunityOwner(long groupId)
Deprecated. As of 6.1.0, renamed to PermissionChecker.isGroupOwner(long)

Specified by:
isCommunityOwner in interface PermissionChecker

isOmniadmin

public boolean isOmniadmin()
Description copied from interface: PermissionChecker
Returns true if the user is a universal administrator.

Specified by:
isOmniadmin in interface PermissionChecker
Returns:
true if the user is a universal administrator; false otherwise
See Also:
OmniadminUtil

isSignedIn

public boolean isSignedIn()
Description copied from interface: PermissionChecker
Returns true if the user is signed in.

Specified by:
isSignedIn in interface PermissionChecker
Returns:
true if the user is signed in; false otherwise

resetValues

public void resetValues()
Specified by:
resetValues in interface PermissionChecker

setValues

public void setValues(PortletRequest portletRequest)
Specified by:
setValues in interface PermissionChecker

Liferay 6.1.2-ce-ga3