Liferay 6.1.2-ce-ga3

com.liferay.portal.security.permission
Interface PermissionChecker

All Superinterfaces:
Cloneable
All Known Implementing Classes:
AdvancedPermissionChecker, BasePermissionChecker, SimplePermissionChecker

public interface PermissionChecker
extends Cloneable


Field Summary
static long[] DEFAULT_ROLE_IDS
           
 
Method Summary
 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 hasOwnerPermission(long companyId, String name, String 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.
 boolean hasPermission(long groupId, String name, String primKey, String actionId)
          Returns true if the user has permission to perform the action on the resource.
 boolean hasUserPermission(long groupId, String name, String primKey, String actionId, boolean checkAdmin)
          Returns true if the user has permission to perform the action on the resource without using guest permissions.
 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 isGroupAdmin(long)
 boolean isCommunityOwner(long groupId)
          Deprecated. As of 6.1.0, renamed to isGroupOwner(long)
 boolean isCompanyAdmin()
          Returns true if the user is an administrator of their company.
 boolean isCompanyAdmin(long companyId)
          Returns true if the user is an administrator of the company.
 boolean isGroupAdmin(long groupId)
          Returns true if the user is an administrator of the group.
 boolean isGroupMember(long groupId)
          Returns true if the user is a member of the group.
 boolean isGroupOwner(long groupId)
          Returns true if the user is the owner of the group.
 boolean isOmniadmin()
          Returns true if the user is a universal administrator.
 boolean isOrganizationAdmin(long organizationId)
          Returns true if the user is an administrator of the organization.
 boolean isOrganizationOwner(long organizationId)
          Returns true if the user is an owner of the organization.
 boolean isSignedIn()
          Returns true if the user is signed in.
 void resetValues()
          Deprecated. Does nothing
 void setValues(PortletRequest portletRequest)
          Deprecated. Does nothing
 

Field Detail

DEFAULT_ROLE_IDS

static final long[] DEFAULT_ROLE_IDS
Method Detail

clone

PermissionChecker clone()

getCompanyId

long getCompanyId()
Returns the primary key of the user's company.

Returns:
the primary key of the user's company

getGuestResourceBlockIds

List<Long> getGuestResourceBlockIds(long companyId,
                                    long groupId,
                                    String name,
                                    String actionId)

getOwnerResourceBlockIds

List<Long> getOwnerResourceBlockIds(long companyId,
                                    long groupId,
                                    String name,
                                    String actionId)

getOwnerRoleId

long getOwnerRoleId()
Returns the primary key of the owner role. This role is automatically given to the creator of a resource.

Returns:
the primary key of the owner role

getResourceBlockIds

List<Long> getResourceBlockIds(long companyId,
                               long groupId,
                               long userId,
                               String name,
                               String actionId)

getRoleIds

long[] getRoleIds(long userId,
                  long groupId)
Returns the primary keys of the roles the user has within the group.

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

long getUserId()
Returns the primary key of the user.

Returns:
the primary key of the user

hasOwnerPermission

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.

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

hasOwnerPermission

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

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

boolean hasPermission(long groupId,
                      String name,
                      long primKey,
                      String actionId)
Returns true if the user has permission to perform the action on the resource.

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

hasPermission

boolean hasPermission(long groupId,
                      String name,
                      String primKey,
                      String actionId)
Returns true if the user has permission to perform the action on the resource.

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

hasUserPermission

boolean hasUserPermission(long groupId,
                          String name,
                          String primKey,
                          String actionId,
                          boolean checkAdmin)
Returns true if the user has permission to perform the action on the resource without using guest permissions.

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
checkAdmin - whether to use permissions gained from administrator roles
Returns:
true if the user has permission to perform the action on the resource without using guest permissions; false otherwise

init

void init(User user)
Initializes this permission checker.

Parameters:
user - the current user

isCheckGuest

boolean isCheckGuest()
Returns true if guest permissions will be used in permission checks.

Returns:
true if guest permissions will be used in permission checks; false otherwise

isCommunityAdmin

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


isCommunityOwner

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


isCompanyAdmin

boolean isCompanyAdmin()
Returns true if the user is an administrator of their company.

Returns:
true if the user is an administrator of their company; false otherwise

isCompanyAdmin

boolean isCompanyAdmin(long companyId)
Returns true if the user is an administrator of the company.

Parameters:
companyId - the primary key of the company
Returns:
true if the user is an administrator of the company; false otherwise

isGroupAdmin

boolean isGroupAdmin(long groupId)
Returns true if the user is an administrator of the group.

Parameters:
groupId - the primary key of the group
Returns:
true if the user is an administrator of the group; false otherwise

isGroupMember

boolean isGroupMember(long groupId)
Returns true if the user is a member of the group.

Parameters:
groupId - the primary key of the group
Returns:
true if the user is a member of the group; false otherwise

isGroupOwner

boolean isGroupOwner(long groupId)
Returns true if the user is the owner of the group.

Parameters:
groupId - the primary key of the group
Returns:
true if the user is the owner of the group; false otherwise

isOmniadmin

boolean isOmniadmin()
Returns true if the user is a universal administrator.

Returns:
true if the user is a universal administrator; false otherwise
See Also:
OmniadminUtil

isOrganizationAdmin

boolean isOrganizationAdmin(long organizationId)
Returns true if the user is an administrator of the organization.

Parameters:
organizationId - the primary key of the organization
Returns:
true if the user is an administrator of the organization; false otherwise

isOrganizationOwner

boolean isOrganizationOwner(long organizationId)
Returns true if the user is an owner of the organization.

Parameters:
organizationId - the primary key of the organization
Returns:
true if the user is an owner of the organization; false otherwise

isSignedIn

boolean isSignedIn()
Returns true if the user is signed in.

Returns:
true if the user is signed in; false otherwise

resetValues

void resetValues()
Deprecated. Does nothing


setValues

void setValues(PortletRequest portletRequest)
Deprecated. Does nothing


Liferay 6.1.2-ce-ga3