Liferay 6.2-ce-ga5

com.liferay.portal.security.permission
Class SimplePermissionChecker

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

public class SimplePermissionChecker
extends BasePermissionChecker


Field Summary
 
Fields inherited from class com.liferay.portal.security.permission.BasePermissionChecker
checkGuest, defaultUserId, omniadmin, ownerRole, signedIn, user
 
Fields inherited from interface com.liferay.portal.security.permission.PermissionChecker
DEFAULT_ROLE_IDS
 
Constructor Summary
SimplePermissionChecker()
           
 
Method Summary
 SimplePermissionChecker clone()
           
 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, String primKey, String actionId)
          Returns true if the user has permission to perform the action on the resource.
protected  boolean hasPermission(String actionId)
           
 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.
 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 isContentReviewer(long companyId, long groupId)
          Returns true if the user is a content reviewer or has sufficient permissions to review content (i.e. the user is a company or group administrator).
 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 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.
 
Methods inherited from class com.liferay.portal.security.permission.BasePermissionChecker
getCompanyId, getGuestResourceBlockIds, getOwnerResourceBlockIds, getOwnerRoleId, getResourceBlockIds, getRoleIds, getUser, getUserId, hasOwnerPermission, hasPermission, init, isCheckGuest, isCommunityAdmin, isCommunityOwner, isOmniadmin, isSignedIn, resetValues, setValues
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePermissionChecker

public SimplePermissionChecker()
Method Detail

clone

public SimplePermissionChecker clone()
Specified by:
clone in interface PermissionChecker
Specified by:
clone in class BasePermissionChecker

hasOwnerPermission

public boolean hasOwnerPermission(long companyId,
                                  String name,
                                  String 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.

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,
                             String primKey,
                             String actionId)
Description copied from interface: PermissionChecker
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

public boolean hasUserPermission(long groupId,
                                 String name,
                                 String primKey,
                                 String actionId,
                                 boolean checkAdmin)
Description copied from interface: PermissionChecker
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

isCompanyAdmin

public boolean isCompanyAdmin()
Description copied from interface: PermissionChecker
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

public boolean isCompanyAdmin(long companyId)
Description copied from interface: PermissionChecker
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

isContentReviewer

public boolean isContentReviewer(long companyId,
                                 long groupId)
Description copied from interface: PermissionChecker
Returns true if the user is a content reviewer or has sufficient permissions to review content (i.e. the user is a company or group administrator).

Parameters:
companyId - the primary key of the company
groupId - the primary key of the group
Returns:
true if the user is a reviewer or has sufficient permissions to review content; false otherwise

isGroupAdmin

public boolean isGroupAdmin(long groupId)
Description copied from interface: PermissionChecker
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

public boolean isGroupMember(long groupId)
Description copied from interface: PermissionChecker
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

public boolean isGroupOwner(long groupId)
Description copied from interface: PermissionChecker
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

isOrganizationAdmin

public boolean isOrganizationAdmin(long organizationId)
Description copied from interface: PermissionChecker
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

public boolean isOrganizationOwner(long organizationId)
Description copied from interface: PermissionChecker
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

hasPermission

protected boolean hasPermission(String actionId)

Liferay 6.2-ce-ga5