|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.portal.service.BaseLocalServiceImpl com.liferay.portal.service.base.PermissionLocalServiceBaseImpl com.liferay.portal.service.impl.PermissionLocalServiceImpl
public class PermissionLocalServiceImpl
The implementation of the permission local service.
Field Summary |
---|
Constructor Summary | |
---|---|
PermissionLocalServiceImpl()
|
Method Summary | |
---|---|
Permission |
addPermission(long companyId,
String actionId,
long resourceId)
Adds a permission to perform the action on the resource. |
List<Permission> |
addPermissions(long companyId,
List<String> actionIds,
long resourceId)
Adds permissions to perform the actions on the resource. |
List<Permission> |
addPermissions(long companyId,
String name,
long resourceId,
boolean portletActions)
Adds permissions to perform either the portlet resource actions or model resource actions on the resource. |
void |
addUserPermissions(long userId,
String[] actionIds,
long resourceId)
Adds user permissions to perform the actions on the resource. |
protected boolean |
checkOrgGroupPermission(List<Organization> organizations,
List<Group> groups,
List<Permission> permissions)
|
protected boolean |
checkOrgGroupPermission(List<Organization> organizations,
List<Group> groups,
Permission permission)
|
void |
checkPermissions(String name,
List<String> actionIds)
Checks to see if the actions are permitted on the named resource. |
List<String> |
getActions(List<Permission> permissions)
Returns the IDs of all the actions belonging to the permissions. |
List<Permission> |
getGroupPermissions(long groupId,
long resourceId)
Returns all the group's permissions on the resource. |
List<Permission> |
getGroupPermissions(long groupId,
long companyId,
String name,
int scope,
String primKey)
Returns all the group's permissions on the named resource with the scope and primKey. |
long |
getLatestPermissionId()
Returns the primary key of the latest permission created. |
List<Permission> |
getOrgGroupPermissions(long organizationId,
long groupId,
long resourceId)
Returns all the permissions of the organization's group with respect to the resource. |
List<Permission> |
getPermissions(long companyId,
String[] actionIds,
long resourceId)
Returns all the permissions to perform the actions on the resource, creating new permissions for any permissions not found. |
List<Permission> |
getRolePermissions(long roleId)
Returns all the role's permissions. |
List<Permission> |
getRolePermissions(long roleId,
int[] scopes)
|
List<Permission> |
getRolePermissions(long roleId,
long resourceId)
Returns all the role's permissions on the resource. |
List<Permission> |
getUserPermissions(long userId)
Returns all the user's permissions. |
List<Permission> |
getUserPermissions(long userId,
long resourceId)
Returns all the user's permissions on the resource. |
List<Permission> |
getUserPermissions(long userId,
long companyId,
String name,
int scope,
String primKey)
Returns all the user's permissions on the named resource with the scope and primKey. |
boolean |
hasGroupPermission(long groupId,
String actionId,
long resourceId)
Returns true if the group has permission to perform the
action on the resource. |
boolean |
hasRolePermission(long roleId,
long companyId,
String name,
int scope,
String actionId)
Returns true if the role has permission to perform the
action on the named resource with the scope. |
boolean |
hasRolePermission(long roleId,
long companyId,
String name,
int scope,
String primKey,
String actionId)
Returns true if the role has permission to perform the
action on the named resource with the scope and primKey. |
boolean |
hasUserPermission(long userId,
String actionId,
long resourceId)
Returns true if the user has permission to perform the
action on the resource. |
protected boolean |
hasUserPermissions_1(long userId,
long resourceId,
String actionId,
List<Permission> permissions,
List<Group> groups,
long groupId,
org.apache.commons.lang.time.StopWatch stopWatch,
int block)
|
protected boolean |
hasUserPermissions_2(long userId,
long resourceId,
String actionId,
List<Permission> permissions,
List<Group> groups,
long groupId,
org.apache.commons.lang.time.StopWatch stopWatch,
int block)
|
protected boolean |
hasUserPermissions_3(long userId,
long resourceId,
String actionId,
List<Permission> permissions,
List<Group> groups,
List<Role> roles,
org.apache.commons.lang.time.StopWatch stopWatch,
int block)
|
protected boolean |
hasUserPermissions_4(long userId,
long resourceId,
String actionId,
List<Permission> permissions,
List<Group> groups,
List<Role> roles,
org.apache.commons.lang.time.StopWatch stopWatch,
int block)
|
protected boolean |
hasUserPermissions_5(long userId,
long resourceId,
String actionId,
List<Permission> permissions,
List<Role> roles,
org.apache.commons.lang.time.StopWatch stopWatch,
int block)
|
protected boolean |
hasUserPermissions_6(long userId,
long resourceId,
List<Resource> resources,
String actionId,
long[] roleIds,
org.apache.commons.lang.time.StopWatch stopWatch,
int block)
|
boolean |
hasUserPermissions(long userId,
long groupId,
List<Resource> resources,
String actionId,
PermissionCheckerBag permissionCheckerBag)
Returns true if the user has permission to perform the
action on the resources. |
protected void |
logHasUserPermissions(long userId,
long resourceId,
String actionId,
org.apache.commons.lang.time.StopWatch stopWatch,
int block)
|
protected void |
setContainerResourcePermissions(long companyId,
String name,
String roleName,
String actionId)
|
void |
setContainerResourcePermissions(String name,
String roleName,
String actionId)
Sets the container wide permissions of either the role or the default user of each company to perform the actions on the named resource. |
void |
setGroupPermissions(long groupId,
String[] actionIds,
long resourceId)
Sets the group's permissions to perform the actions on the resource, replacing the group's existing permissions on the resource. |
void |
setGroupPermissions(String className,
String classPK,
long groupId,
String[] actionIds,
long resourceId)
Sets the entity's group permissions to perform the actions on the resource, replacing the entity's existing group permissions on the resource. |
void |
setOrgGroupPermissions(long organizationId,
long groupId,
String[] actionIds,
long resourceId)
Sets the organization's group permissions to perform the actions on the resource, replacing the organization's existing group permissions on the resource. |
void |
setRolePermission(long roleId,
long companyId,
String name,
int scope,
String primKey,
String actionId)
Sets the role's permissions to perform the action on the named resource, replacing the role's existing permissions on the resource. |
void |
setRolePermissions(long roleId,
long companyId,
String name,
int scope,
String primKey,
String[] actionIds)
Sets the role's permissions to perform the actions on the named resource, replacing the role's existing permission for each of these actions on the resource. |
void |
setRolePermissions(long roleId,
String[] actionIds,
long resourceId)
Sets the role's permissions to perform the actions on the resource, replacing the role's existing permissions on the resource. |
void |
setRolesPermissions(long companyId,
Map<Long,String[]> roleIdsToActionIds,
long resourceId)
Sets the permissions of each role to perform respective actions on the resource, replacing the existing permissions of each role on the resource. |
void |
setRolesPermissions(long companyId,
Map<Long,String[]> roleIdsToActionIds,
String name,
int scope,
String primKey)
Sets the permissions of each role to perform respective actions on the named resource, replacing the existing permissions of each role on the resource. |
void |
setUserPermissions(long userId,
String[] actionIds,
long resourceId)
Sets the user's permissions to perform the actions on the resource, replacing the user's existing permissions on the resource. |
void |
unsetRolePermission(long roleId,
long permissionId)
Removes the permission from the role. |
void |
unsetRolePermission(long roleId,
long companyId,
String name,
int scope,
String primKey,
String actionId)
Removes the role's permissions to perform the action on the named resource with the scope and primKey. |
void |
unsetRolePermissions(long roleId,
long companyId,
String name,
int scope,
String actionId)
Removes the role's permissions to perform the action on the named resource. |
void |
unsetUserPermissions(long userId,
String[] actionIds,
long resourceId)
Removes the user's permissions to perform the actions on the resource. |
Methods inherited from class com.liferay.portal.service.BaseLocalServiceImpl |
---|
getClassLoader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PermissionLocalServiceImpl()
Method Detail |
---|
public Permission addPermission(long companyId, String actionId, long resourceId) throws SystemException
This method will retrieve the permission of the company, action, and resource with the primary keys. The method creates the permission if it fails to retrieve it.
companyId
- the primary key of the companyactionId
- the action's IDresourceId
- the primary key of the resource
SystemException
- if a system exception occurredpublic List<Permission> addPermissions(long companyId, List<String> actionIds, long resourceId) throws SystemException
This method will retrieve the permissions of the company, actions, and resource with the primary keys. The method creates any permissions it fails to retrieve.
companyId
- the primary key of the companyactionIds
- the primary keys of the actionsresourceId
- the primary key of the resource
SystemException
- if a system exception occurredpublic List<Permission> addPermissions(long companyId, String name, long resourceId, boolean portletActions) throws SystemException
This method will retrieve the permissions of the company, actions, and resource with the primary keys. The method creates any permissions it fails to retrieve.
companyId
- the primary key of the companyname
- the resource nameresourceId
- the primary key of the resourceportletActions
- whether to retrieve the action primary keys from
the portlet or the model resource
SystemException
- if a system exception occurredpublic void addUserPermissions(long userId, String[] actionIds, long resourceId) throws PortalException, SystemException
userId
- the primary key of the useractionIds
- the primary keys of the actionsresourceId
- the primary key of the resource
PortalException
- if a user with the primary key could not be found
SystemException
- if a system exception occurredpublic void checkPermissions(String name, List<String> actionIds) throws PortalException, SystemException
name
- the resource nameactionIds
- the primary keys of the actions
PortalException
- if the resource company or name could not be
found or were invalid
SystemException
- if a system exception occurredpublic List<String> getActions(List<Permission> permissions)
permissions
- the permissions
public List<Permission> getGroupPermissions(long groupId, long resourceId) throws SystemException
groupId
- the primary key of the groupresourceId
- the primary key of the resource
SystemException
- if a system exception occurredpublic List<Permission> getGroupPermissions(long groupId, long companyId, String name, int scope, String primKey) throws SystemException
groupId
- the primary key of the groupcompanyId
- the primary key of the companyname
- the resource namescope
- the resource scopeprimKey
- the resource primKey
SystemException
- if a system exception occurredpublic long getLatestPermissionId() throws SystemException
SystemException
- if a system exception occurredpublic List<Permission> getOrgGroupPermissions(long organizationId, long groupId, long resourceId) throws SystemException
organizationId
- the primary key of the organizationgroupId
- the primary key of the groupresourceId
- the primary key of the resource
SystemException
- if a system exception occurredpublic List<Permission> getPermissions(long companyId, String[] actionIds, long resourceId) throws SystemException
companyId
- the primary key of the companyactionIds
- the primary keys of the actionsresourceId
- the primary key of the resource
SystemException
- if a system exception occurredaddPermission(long, String, long)
public List<Permission> getRolePermissions(long roleId) throws SystemException
getRolePermissions
in interface PermissionLocalService
getRolePermissions
in class PermissionLocalServiceBaseImpl
roleId
- the primary key of the role
SystemException
- if a system exception occurredpublic List<Permission> getRolePermissions(long roleId, int[] scopes) throws SystemException
SystemException
public List<Permission> getRolePermissions(long roleId, long resourceId) throws SystemException
roleId
- the primary key of the roleresourceId
- the primary key of the resource
SystemException
- if a system exception occurredpublic List<Permission> getUserPermissions(long userId) throws SystemException
getUserPermissions
in interface PermissionLocalService
getUserPermissions
in class PermissionLocalServiceBaseImpl
userId
- the primary key of the user
SystemException
- if a system exception occurredpublic List<Permission> getUserPermissions(long userId, long resourceId) throws SystemException
userId
- the primary key of the userresourceId
- the primary key of the resource
SystemException
- if a system exception occurredpublic List<Permission> getUserPermissions(long userId, long companyId, String name, int scope, String primKey) throws SystemException
userId
- the primary key of the usercompanyId
- the primary key of the companyname
- the resource namescope
- the resource scopeprimKey
- the resource primKey
SystemException
- if a system exception occurredpublic boolean hasGroupPermission(long groupId, String actionId, long resourceId) throws SystemException
true
if the group has permission to perform the
action on the resource.
groupId
- the primary key of the groupactionId
- the action's IDresourceId
- the primary key of the resource
true
if the group has permission to perform the
action on the resource; false
otherwise
SystemException
- if a system exception occurredpublic boolean hasRolePermission(long roleId, long companyId, String name, int scope, String actionId) throws SystemException
true
if the role has permission to perform the
action on the named resource with the scope.
roleId
- the primary key of the rolecompanyId
- the primary key of the companyname
- the resource namescope
- the resource scopeactionId
- the action's ID
true
if the role has permission to perform the
action on the named resource with the scope; false
otherwise
SystemException
- if a system exception occurredpublic boolean hasRolePermission(long roleId, long companyId, String name, int scope, String primKey, String actionId) throws SystemException
true
if the role has permission to perform the
action on the named resource with the scope and primKey.
roleId
- the primary key of the rolecompanyId
- the primary key of the companyname
- the resource namescope
- the resource scopeprimKey
- the resource primKeyactionId
- the action's ID
true
if the role has permission to perform the
action on the named resource with the scope and primKey;
false
otherwise
SystemException
- if a system exception occurredpublic boolean hasUserPermission(long userId, String actionId, long resourceId) throws SystemException
true
if the user has permission to perform the
action on the resource.
userId
- the primary key of the useractionId
- the action's IDresourceId
- the primary key of the resource
true
if the user has permission to perform the
action on the resource; false
otherwise
SystemException
- if a system exception occurredpublic boolean hasUserPermissions(long userId, long groupId, List<Resource> resources, String actionId, PermissionCheckerBag permissionCheckerBag) throws PortalException, SystemException
true
if the user has permission to perform the
action on the resources.
This method does not support resources managed by the resource block system.
userId
- the primary key of the usergroupId
- the primary key of the group containing the resourceresources
- representations of the resource at each scope level
returned by AdvancedPermissionChecker.getResources(
long, long, String, String, String)
actionId
- the action's IDpermissionCheckerBag
- the permission checker bag
true
if the user has permission to perform the
action on the resources; false
otherwise
PortalException
- if a resource action based on any one of the
resources and the action ID could not be found
SystemException
- if a system exception occurredpublic void setContainerResourcePermissions(String name, String roleName, String actionId) throws PortalException, SystemException
name
- the resource nameroleName
- the role name. Supported role names include RoleConstants.ORGANIZATION_USER
, RoleConstants.OWNER
, and RoleConstants.SITE_MEMBER
.actionId
- the action's ID
PortalException
- if a matching role could not be found or if a
default user for the company could not be found
SystemException
- if a system exception occurredpublic void setGroupPermissions(long groupId, String[] actionIds, long resourceId) throws PortalException, SystemException
groupId
- the primary key of the groupactionIds
- the primary keys of the actionsresourceId
- the primary key of the resource
PortalException
- if a group with the primary key could not be
found
SystemException
- if a system exception occurredpublic void setGroupPermissions(String className, String classPK, long groupId, String[] actionIds, long resourceId) throws PortalException, SystemException
Organization
and UserGroup
class entities are supported.
className
- the class name of an organization or user groupclassPK
- the primary key of the classgroupId
- the primary key of the groupactionIds
- the primary keys of the actionsresourceId
- the primary key of the resource
PortalException
- if an entity with the class name and primary key
could not be found or if the entity's associated group could not
be found
SystemException
- if a system exception occurredpublic void setOrgGroupPermissions(long organizationId, long groupId, String[] actionIds, long resourceId) throws PortalException, SystemException
organizationId
- the primary key of the organizationgroupId
- the primary key of the group in which to scope the
permissionsactionIds
- the primary keys of the actionsresourceId
- the primary key of the resource
PortalException
- if an organization with the primary key could not
be found
SystemException
- if a system exception occurredpublic void setRolePermission(long roleId, long companyId, String name, int scope, String primKey, String actionId) throws PortalException, SystemException
roleId
- the primary key of the rolecompanyId
- the primary key of the companyname
- the resource namescope
- the resource scopeprimKey
- the resource primKeyactionId
- the action's ID
PortalException
- if the scope was ResourceConstants.SCOPE_INDIVIDUAL
SystemException
- if a system exception occurredpublic void setRolePermissions(long roleId, long companyId, String name, int scope, String primKey, String[] actionIds) throws PortalException, SystemException
roleId
- the primary key of the rolecompanyId
- the primary key of the companyname
- the resource namescope
- the resource scopeprimKey
- the resource primKeyactionIds
- the primary keys of the actions
PortalException
- if the scope was ResourceConstants.SCOPE_INDIVIDUAL
SystemException
- if a system exception occurredpublic void setRolePermissions(long roleId, String[] actionIds, long resourceId) throws PortalException, SystemException
roleId
- the primary key of the roleactionIds
- the primary keys of the actionsresourceId
- the primary key of the resource
PortalException
- if a role with the primary key could not be found
SystemException
- if a system exception occurredpublic void setRolesPermissions(long companyId, Map<Long,String[]> roleIdsToActionIds, long resourceId) throws SystemException
companyId
- the primary key of the companyroleIdsToActionIds
- the map of roles to their new actions on the
resourceresourceId
- the primary key of the resource
SystemException
- if a system exception occurredpublic void setRolesPermissions(long companyId, Map<Long,String[]> roleIdsToActionIds, String name, int scope, String primKey) throws SystemException
companyId
- the primary key of the companyroleIdsToActionIds
- the map of roles to their new actions on the
resourcename
- the resource namescope
- the resource scopeprimKey
- the resource primKey
SystemException
- if a system exception occurredpublic void setUserPermissions(long userId, String[] actionIds, long resourceId) throws PortalException, SystemException
userId
- the primary key of the useractionIds
- the primary keys of the actionsresourceId
- the primary key of the resource
PortalException
- if a user with the primary key could not be found
SystemException
- if a system exception occurredpublic void unsetRolePermission(long roleId, long permissionId) throws SystemException
roleId
- the primary key of the rolepermissionId
- the primary key of the permission
SystemException
- if a system exception occurredpublic void unsetRolePermission(long roleId, long companyId, String name, int scope, String primKey, String actionId) throws SystemException
roleId
- the primary key of the rolecompanyId
- the primary key of the companyname
- the resource namescope
- the resource scopeprimKey
- the resource primKeyactionId
- the action's ID
SystemException
- if a system exception occurredpublic void unsetRolePermissions(long roleId, long companyId, String name, int scope, String actionId) throws SystemException
roleId
- the primary key of the rolecompanyId
- the primary key of the companyname
- the resource namescope
- the resource scopeactionId
- the action's ID
SystemException
- if a system exception occurredpublic void unsetUserPermissions(long userId, String[] actionIds, long resourceId) throws SystemException
userId
- the primary key of the useractionIds
- the primary keys of the actionsresourceId
- the primary key of the resource
SystemException
- if a system exception occurredprotected boolean checkOrgGroupPermission(List<Organization> organizations, List<Group> groups, List<Permission> permissions) throws PortalException, SystemException
PortalException
SystemException
protected boolean checkOrgGroupPermission(List<Organization> organizations, List<Group> groups, Permission permission) throws PortalException, SystemException
PortalException
SystemException
protected boolean hasUserPermissions_1(long userId, long resourceId, String actionId, List<Permission> permissions, List<Group> groups, long groupId, org.apache.commons.lang.time.StopWatch stopWatch, int block) throws SystemException
SystemException
protected boolean hasUserPermissions_2(long userId, long resourceId, String actionId, List<Permission> permissions, List<Group> groups, long groupId, org.apache.commons.lang.time.StopWatch stopWatch, int block) throws SystemException
SystemException
protected boolean hasUserPermissions_3(long userId, long resourceId, String actionId, List<Permission> permissions, List<Group> groups, List<Role> roles, org.apache.commons.lang.time.StopWatch stopWatch, int block) throws SystemException
SystemException
protected boolean hasUserPermissions_4(long userId, long resourceId, String actionId, List<Permission> permissions, List<Group> groups, List<Role> roles, org.apache.commons.lang.time.StopWatch stopWatch, int block) throws SystemException
SystemException
protected boolean hasUserPermissions_5(long userId, long resourceId, String actionId, List<Permission> permissions, List<Role> roles, org.apache.commons.lang.time.StopWatch stopWatch, int block) throws SystemException
SystemException
protected boolean hasUserPermissions_6(long userId, long resourceId, List<Resource> resources, String actionId, long[] roleIds, org.apache.commons.lang.time.StopWatch stopWatch, int block) throws PortalException, SystemException
PortalException
SystemException
protected void logHasUserPermissions(long userId, long resourceId, String actionId, org.apache.commons.lang.time.StopWatch stopWatch, int block)
protected void setContainerResourcePermissions(long companyId, String name, String roleName, String actionId) throws PortalException, SystemException
PortalException
SystemException
|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |