|
Liferay 6.1.2-ce-ga3 | |||||||||
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 Map<Long,Boolean> |
companyAdmins
|
protected static String |
RESULTS_SEPARATOR
Deprecated. |
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,
List<Role> roles)
|
AdvancedPermissionChecker |
clone()
|
List<Long> |
getGuestResourceBlockIds(long companyId,
long groupId,
String name,
String actionId)
|
ResourceBlockIdsBag |
getGuestResourceBlockIdsBag(long companyId,
long groupId,
String name)
|
PermissionCheckerBag |
getGuestUserBag()
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. |
PermissionCheckerBag |
getUserBag(long userId,
long groupId)
Returns the permission checker bag for the user and group. |
protected List<Organization> |
getUserOrgs(long userId)
Returns all of the organizations that the user is a member of, including their parent organizations. |
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()
|
protected boolean |
isCompanyAdminImpl(long companyId)
|
boolean |
isGroupAdmin(long groupId)
Returns true if the user is an administrator of the 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(long groupId)
|
boolean |
isOrganizationAdmin(long organizationId)
Returns true if the user is an administrator of the
organization. |
protected boolean |
isOrganizationAdminImpl(long organizationId)
|
boolean |
isOrganizationOwner(long organizationId)
Returns true if the user is an owner of the organization. |
protected boolean |
isOrganizationOwnerImpl(long organizationId)
|
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, 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 |
---|
protected static final String RESULTS_SEPARATOR
protected Map<Long,Boolean> companyAdmins
Constructor Detail |
---|
public AdvancedPermissionChecker()
Method Detail |
---|
public AdvancedPermissionChecker clone()
clone
in interface PermissionChecker
clone
in class BasePermissionChecker
public List<Long> getGuestResourceBlockIds(long companyId, long groupId, String name, String actionId)
getGuestResourceBlockIds
in interface PermissionChecker
getGuestResourceBlockIds
in class BasePermissionChecker
public ResourceBlockIdsBag getGuestResourceBlockIdsBag(long companyId, long groupId, String name) throws Exception
Exception
public PermissionCheckerBag getGuestUserBag() throws Exception
Exception
- if an exception occurredpublic List<Long> getOwnerResourceBlockIds(long companyId, long groupId, String name, String actionId)
getOwnerResourceBlockIds
in interface PermissionChecker
getOwnerResourceBlockIds
in class BasePermissionChecker
public ResourceBlockIdsBag getOwnerResourceBlockIdsBag(long companyId, long groupId, String name) throws SystemException
SystemException
public List<Long> getResourceBlockIds(long companyId, long groupId, long userId, String name, String actionId)
getResourceBlockIds
in interface PermissionChecker
getResourceBlockIds
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 PermissionChecker
getRoleIds
in class BasePermissionChecker
userId
- the primary key of the usergroupId
- the primary key of the group
public PermissionCheckerBag getUserBag(long userId, long groupId) throws Exception
userId
- the primary key of the usergroupId
- the primary key of the group
Exception
- if a user or group with the primary key could not be
foundpublic boolean hasOwnerPermission(long companyId, String name, String primKey, long ownerId, String actionId)
PermissionChecker
true
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
otherwisepublic boolean hasPermission(long groupId, String name, String primKey, String actionId)
PermissionChecker
true
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
otherwisepublic boolean hasUserPermission(long groupId, String name, String primKey, String actionId, boolean checkAdmin)
PermissionChecker
true
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()
PermissionChecker
true
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)
PermissionChecker
true
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
otherwisepublic boolean isGroupAdmin(long groupId)
PermissionChecker
true
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)
PermissionChecker
true
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)
PermissionChecker
true
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)
PermissionChecker
true
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)
PermissionChecker
true
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
otherwiseprotected void addTeamRoles(long userId, Group group, List<Role> roles) 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 occurredprotected List<Organization> getUserOrgs(long userId) throws Exception
userId
- the primary key of the user
Exception
- if a user with the primary key could not be foundprotected 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() throws Exception
Exception
protected boolean isCompanyAdminImpl(long companyId) throws Exception
Exception
protected boolean isGroupAdminImpl(long groupId) throws Exception
Exception
protected boolean isGroupMemberImpl(long groupId) throws Exception
Exception
protected boolean isGroupOwnerImpl(long groupId) throws Exception
Exception
protected boolean isOrganizationAdminImpl(long organizationId) throws Exception
Exception
protected boolean isOrganizationOwnerImpl(long organizationId) throws Exception
Exception
protected void logHasUserPermission(long groupId, String name, String primKey, String actionId, org.apache.commons.lang.time.StopWatch stopWatch, int block)
|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |