|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.portal.security.permission.BasePermissionChecker
com.liferay.portal.security.permission.AdvancedPermissionChecker
public class AdvancedPermissionChecker
| Field Summary | |
|---|---|
protected static String |
RESULTS_SEPARATOR
Deprecated. As of 6.1.0 |
| 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 | |
|---|---|
AdvancedPermissionChecker()
|
|
| Method Summary | |
|---|---|
protected void |
addTeamRoles(long userId,
Group group,
Set<Long> roleIds)
|
AdvancedPermissionChecker |
clone()
|
protected boolean |
doCheckPermission(long companyId,
long groupId,
String name,
String primKey,
String actionId,
org.apache.commons.lang.time.StopWatch stopWatch)
|
protected long[] |
doGetRoleIds(long userId,
long groupId)
|
ResourceBlockIdsBag |
getGuestResourceBlockIdsBag(long companyId,
long groupId,
String name)
|
long[] |
getGuestUserRoleIds()
Returns the permission checker bag for the guest user. |
List<Long> |
getOwnerResourceBlockIds(long companyId,
long groupId,
String name,
String actionId)
|
ResourceBlockIdsBag |
getOwnerResourceBlockIdsBag(long companyId,
long groupId,
String name)
|
List<Long> |
getResourceBlockIds(long companyId,
long groupId,
long userId,
String name,
String actionId)
|
ResourceBlockIdsBag |
getResourceBlockIdsBag(long companyId,
long groupId,
long userId,
String name)
|
protected List<Resource> |
getResources(long companyId,
long groupId,
String name,
String primKey,
String actionId)
Returns representations of the resource at each scope level. |
long[] |
getRoleIds(long userId,
long groupId)
Returns the primary keys of the roles the user has within the group. |
UserBag |
getUserBag()
|
protected boolean |
hasGuestPermission(long groupId,
String name,
String primKey,
String actionId)
|
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 |
hasPermissionImpl(long groupId,
String name,
String primKey,
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. |
protected boolean |
hasUserPermissionImpl(long groupId,
String name,
String primKey,
String actionId,
boolean checkAdmin)
|
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. |
protected boolean |
isCompanyAdminImpl(long companyId)
|
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). |
protected boolean |
isContentReviewerImpl(long groupId)
|
protected boolean |
isContentReviewerImpl(long companyId,
long groupId)
|
boolean |
isGroupAdmin(long groupId)
Returns true if the user is an administrator of the group. |
protected boolean |
isGroupAdminImpl(Group group)
|
protected boolean |
isGroupAdminImpl(long groupId)
|
boolean |
isGroupMember(long groupId)
Returns true if the user is a member of the group. |
protected boolean |
isGroupMemberImpl(long groupId)
|
boolean |
isGroupOwner(long groupId)
Returns true if the user is the owner of the group. |
protected boolean |
isGroupOwnerImpl(Group group)
|
protected boolean |
isGroupOwnerImpl(long groupId)
|
boolean |
isOrganizationAdmin(long organizationId)
Returns true if the user is an administrator of the
organization. |
protected boolean |
isOrganizationAdminImpl(long organizationId)
|
protected boolean |
isOrganizationAdminImpl(Organization organization)
|
boolean |
isOrganizationOwner(long organizationId)
Returns true if the user is an owner of the organization. |
protected boolean |
isOrganizationOwnerImpl(long organizationId)
|
protected boolean |
isOrganizationOwnerImpl(Organization organization)
|
protected void |
logHasUserPermission(long groupId,
String name,
String primKey,
String actionId,
org.apache.commons.lang.time.StopWatch stopWatch,
int block)
|
| Methods inherited from class com.liferay.portal.security.permission.BasePermissionChecker |
|---|
getCompanyId, getOwnerRoleId, 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 |
| Field Detail |
|---|
@Deprecated protected static final String RESULTS_SEPARATOR
| Constructor Detail |
|---|
public AdvancedPermissionChecker()
| Method Detail |
|---|
public AdvancedPermissionChecker clone()
clone in interface PermissionCheckerclone in class BasePermissionChecker
public ResourceBlockIdsBag getGuestResourceBlockIdsBag(long companyId,
long groupId,
String name)
throws Exception
Exception
public long[] getGuestUserRoleIds()
throws Exception
Exception - if an exception occurred
public List<Long> getOwnerResourceBlockIds(long companyId,
long groupId,
String name,
String actionId)
getOwnerResourceBlockIds in interface PermissionCheckergetOwnerResourceBlockIds in class BasePermissionChecker
public ResourceBlockIdsBag getOwnerResourceBlockIdsBag(long companyId,
long groupId,
String name)
public List<Long> getResourceBlockIds(long companyId,
long groupId,
long userId,
String name,
String actionId)
getResourceBlockIds in interface PermissionCheckergetResourceBlockIds in class BasePermissionChecker
public ResourceBlockIdsBag getResourceBlockIdsBag(long companyId,
long groupId,
long userId,
String name)
throws Exception
Exception
public long[] getRoleIds(long userId,
long groupId)
PermissionChecker
getRoleIds in interface PermissionCheckergetRoleIds in class BasePermissionCheckeruserId - the primary key of the usergroupId - the primary key of the group
public UserBag getUserBag()
throws PortalException
PortalException
public boolean hasOwnerPermission(long companyId,
String name,
String primKey,
long ownerId,
String actionId)
PermissionCheckertrue if the user is the owner of the resource and
has permission to perform the action.
companyId - the primary key of the user's companyname - the resource's name, which can be either a class name or a
portlet IDprimKey - the primary key of the resourceownerId - the primary key of the resource's owneractionId - the action ID
true if the user is the owner of the resource and
has permission to perform the action; false
otherwise
public boolean hasPermission(long groupId,
String name,
String primKey,
String actionId)
PermissionCheckertrue if the user has permission to perform the
action on the resource.
groupId - the primary key of the group containing the resourcename - the resource's name, which can be either a class name or a
portlet IDprimKey - the primary key of the resourceactionId - the action ID
true if the user has permission to perform the
action on the resource; false otherwise
public boolean hasUserPermission(long groupId,
String name,
String primKey,
String actionId,
boolean checkAdmin)
PermissionCheckertrue if the user has permission to perform the
action on the resource without using guest permissions.
groupId - the primary key of the group containing the resourcename - the resource's name, which can be either a class name or a
portlet IDprimKey - the primary key of the resourceactionId - the action IDcheckAdmin - whether to use permissions gained from administrator
roles
true if the user has permission to perform the
action on the resource without using guest permissions;
false otherwisepublic boolean isCompanyAdmin()
PermissionCheckertrue if the user is an administrator of their
company.
true if the user is an administrator of their
company; false otherwisepublic boolean isCompanyAdmin(long companyId)
PermissionCheckertrue if the user is an administrator of the company.
companyId - the primary key of the company
true if the user is an administrator of the company;
false otherwise
public boolean isContentReviewer(long companyId,
long groupId)
PermissionCheckertrue if the user is a content reviewer or has
sufficient permissions to review content (i.e. the user is a company or
group administrator).
companyId - the primary key of the companygroupId - the primary key of the group
true if the user is a reviewer or has sufficient
permissions to review content; false otherwisepublic boolean isGroupAdmin(long groupId)
PermissionCheckertrue if the user is an administrator of the group.
groupId - the primary key of the group
true if the user is an administrator of the group;
false otherwisepublic boolean isGroupMember(long groupId)
PermissionCheckertrue if the user is a member of the group.
groupId - the primary key of the group
true if the user is a member of the group;
false otherwisepublic boolean isGroupOwner(long groupId)
PermissionCheckertrue if the user is the owner of the group.
groupId - the primary key of the group
true if the user is the owner of the group;
false otherwisepublic boolean isOrganizationAdmin(long organizationId)
PermissionCheckertrue if the user is an administrator of the
organization.
organizationId - the primary key of the organization
true if the user is an administrator of the
organization; false otherwisepublic boolean isOrganizationOwner(long organizationId)
PermissionCheckertrue if the user is an owner of the organization.
organizationId - the primary key of the organization
true if the user is an owner of the organization;
false otherwise
protected void addTeamRoles(long userId,
Group group,
Set<Long> roleIds)
throws Exception
Exception
protected boolean doCheckPermission(long companyId,
long groupId,
String name,
String primKey,
String actionId,
org.apache.commons.lang.time.StopWatch stopWatch)
throws Exception
Exception
protected long[] doGetRoleIds(long userId,
long groupId)
throws Exception
Exception
protected List<Resource> getResources(long companyId,
long groupId,
String name,
String primKey,
String actionId)
throws Exception
For example, if the class name and primary key of a blog entry were passed to this method, it would return a resource for the blog entry itself (individual scope), a resource representing all blog entries within its group (group scope), a resource standing for all blog entries within a group the user has a suitable role in (group-template scope), and a resource signifying all blog entries within the company (company scope).
companyId - the primary key of the companygroupId - the primary key of the group containing the resourcename - the resource's name, which can be either a class name or a
portlet IDprimKey - the primary key of the resourceactionId - unused
Exception - if an exception occurred
protected boolean hasGuestPermission(long groupId,
String name,
String primKey,
String actionId)
throws Exception
Exception
protected boolean hasPermissionImpl(long groupId,
String name,
String primKey,
String actionId)
protected boolean hasUserPermissionImpl(long groupId,
String name,
String primKey,
String actionId,
boolean checkAdmin)
throws Exception
Exception
protected boolean isCompanyAdminImpl(long companyId)
throws Exception
Exception
protected boolean isContentReviewerImpl(long groupId)
throws PortalException
PortalException
protected boolean isContentReviewerImpl(long companyId,
long groupId)
throws Exception
Exception
protected boolean isGroupAdminImpl(Group group)
throws Exception
Exception
protected boolean isGroupAdminImpl(long groupId)
throws Exception
Exception
protected boolean isGroupMemberImpl(long groupId)
throws Exception
Exception
protected boolean isGroupOwnerImpl(Group group)
throws PortalException
PortalException
protected boolean isGroupOwnerImpl(long groupId)
throws Exception
Exception
protected boolean isOrganizationAdminImpl(long organizationId)
throws Exception
Exception
protected boolean isOrganizationAdminImpl(Organization organization)
throws PortalException
PortalException
protected boolean isOrganizationOwnerImpl(long organizationId)
throws Exception
Exception
protected boolean isOrganizationOwnerImpl(Organization organization)
throws PortalException
PortalException
protected void logHasUserPermission(long groupId,
String name,
String primKey,
String actionId,
org.apache.commons.lang.time.StopWatch stopWatch,
int block)
|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||