Liferay 6.1.2-ce-ga3

com.liferay.portal.service.impl
Class PermissionLocalServiceImpl

java.lang.Object
  extended by com.liferay.portal.service.BaseLocalServiceImpl
      extended by com.liferay.portal.service.base.PermissionLocalServiceBaseImpl
          extended by com.liferay.portal.service.impl.PermissionLocalServiceImpl
All Implemented Interfaces:
IdentifiableBean, BaseLocalService, PermissionLocalService, PersistedModelLocalService

public class PermissionLocalServiceImpl
extends PermissionLocalServiceBaseImpl

The implementation of the permission local service.


Field Summary
 
Fields inherited from class com.liferay.portal.service.base.PermissionLocalServiceBaseImpl
accountLocalService, accountPersistence, accountService, addressLocalService, addressPersistence, addressService, browserTrackerLocalService, browserTrackerPersistence, classNameLocalService, classNamePersistence, classNameService, clusterGroupLocalService, clusterGroupPersistence, cmisRepositoryLocalService, companyLocalService, companyPersistence, companyService, contactLocalService, contactPersistence, contactService, counterLocalService, countryPersistence, countryService, emailAddressLocalService, emailAddressPersistence, emailAddressService, groupFinder, groupLocalService, groupPersistence, groupService, imageLocalService, imagePersistence, imageService, layoutBranchLocalService, layoutBranchPersistence, layoutBranchService, layoutFinder, layoutLocalService, layoutPersistence, layoutPrototypeLocalService, layoutPrototypePersistence, layoutPrototypeService, layoutRevisionLocalService, layoutRevisionPersistence, layoutRevisionService, layoutService, layoutSetBranchLocalService, layoutSetBranchPersistence, layoutSetBranchService, layoutSetLocalService, layoutSetPersistence, layoutSetPrototypeLocalService, layoutSetPrototypePersistence, layoutSetPrototypeService, layoutSetService, layoutTemplateLocalService, listTypePersistence, listTypeService, lockFinder, lockLocalService, lockPersistence, membershipRequestLocalService, membershipRequestPersistence, membershipRequestService, organizationFinder, organizationLocalService, organizationPersistence, organizationService, orgGroupPermissionFinder, orgGroupPermissionPersistence, orgGroupRolePersistence, orgLaborLocalService, orgLaborPersistence, orgLaborService, passwordPolicyFinder, passwordPolicyLocalService, passwordPolicyPersistence, passwordPolicyRelLocalService, passwordPolicyRelPersistence, passwordPolicyService, passwordTrackerLocalService, passwordTrackerPersistence, permissionFinder, permissionLocalService, permissionPersistence, permissionService, persistedModelLocalServiceRegistry, phoneLocalService, phonePersistence, phoneService, pluginSettingLocalService, pluginSettingPersistence, pluginSettingService, portalLocalService, portalPreferencesLocalService, portalPreferencesPersistence, portalService, portletItemLocalService, portletItemPersistence, portletLocalService, portletPersistence, portletPreferencesFinder, portletPreferencesLocalService, portletPreferencesPersistence, portletPreferencesService, portletService, quartzLocalService, regionPersistence, regionService, releaseLocalService, releasePersistence, repositoryEntryLocalService, repositoryEntryPersistence, repositoryLocalService, repositoryPersistence, repositoryService, resourceActionLocalService, resourceActionPersistence, resourceBlockFinder, resourceBlockLocalService, resourceBlockPermissionLocalService, resourceBlockPermissionPersistence, resourceBlockPersistence, resourceBlockService, resourceCodeLocalService, resourceCodePersistence, resourceFinder, resourceLocalService, resourcePermissionFinder, resourcePermissionLocalService, resourcePermissionPersistence, resourcePermissionService, resourcePersistence, resourceService, resourceTypePermissionFinder, resourceTypePermissionLocalService, resourceTypePermissionPersistence, roleFinder, roleLocalService, rolePersistence, roleService, serviceComponentLocalService, serviceComponentPersistence, shardLocalService, shardPersistence, subscriptionLocalService, subscriptionPersistence, teamFinder, teamLocalService, teamPersistence, teamService, themeLocalService, themeService, ticketLocalService, ticketPersistence, userFinder, userGroupFinder, userGroupGroupRoleLocalService, userGroupGroupRolePersistence, userGroupGroupRoleService, userGroupLocalService, userGroupPersistence, userGroupRoleFinder, userGroupRoleLocalService, userGroupRolePersistence, userGroupRoleService, userGroupService, userIdMapperLocalService, userIdMapperPersistence, userLocalService, userNotificationEventLocalService, userNotificationEventPersistence, userPersistence, userService, userTrackerLocalService, userTrackerPathLocalService, userTrackerPathPersistence, userTrackerPersistence, virtualHostLocalService, virtualHostPersistence, webDAVPropsLocalService, webDAVPropsPersistence, websiteLocalService, websitePersistence, websiteService, workflowDefinitionLinkLocalService, workflowDefinitionLinkPersistence, workflowInstanceLinkLocalService, workflowInstanceLinkPersistence
 
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.base.PermissionLocalServiceBaseImpl
addGroupPermission, addGroupPermission, addGroupPermissions, addGroupPermissions, addPermission, addRolePermission, addRolePermission, addRolePermissions, addRolePermissions, addUserPermission, addUserPermission, addUserPermissions, addUserPermissions, afterPropertiesSet, clearGroupPermissions, clearRolePermissions, clearUserPermissions, createPermission, deleteGroupPermission, deleteGroupPermission, deleteGroupPermissions, deleteGroupPermissions, deletePermission, deletePermission, deleteRolePermission, deleteRolePermission, deleteRolePermissions, deleteRolePermissions, deleteUserPermission, deleteUserPermission, deleteUserPermissions, deleteUserPermissions, destroy, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, fetchPermission, getAccountLocalService, getAccountPersistence, getAccountService, getAddressLocalService, getAddressPersistence, getAddressService, getBeanIdentifier, getBrowserTrackerLocalService, getBrowserTrackerPersistence, getClassNameLocalService, getClassNamePersistence, getClassNameService, getClusterGroupLocalService, getClusterGroupPersistence, getCMISRepositoryLocalService, getCompanyLocalService, getCompanyPersistence, getCompanyService, getContactLocalService, getContactPersistence, getContactService, getCounterLocalService, getCountryPersistence, getCountryService, getEmailAddressLocalService, getEmailAddressPersistence, getEmailAddressService, getGroupFinder, getGroupLocalService, getGroupPermissions, getGroupPermissions, getGroupPermissions, getGroupPermissionsCount, getGroupPersistence, getGroupService, getImageLocalService, getImagePersistence, getImageService, getLayoutBranchLocalService, getLayoutBranchPersistence, getLayoutBranchService, getLayoutFinder, getLayoutLocalService, getLayoutPersistence, getLayoutPrototypeLocalService, getLayoutPrototypePersistence, getLayoutPrototypeService, getLayoutRevisionLocalService, getLayoutRevisionPersistence, getLayoutRevisionService, getLayoutService, getLayoutSetBranchLocalService, getLayoutSetBranchPersistence, getLayoutSetBranchService, getLayoutSetLocalService, getLayoutSetPersistence, getLayoutSetPrototypeLocalService, getLayoutSetPrototypePersistence, getLayoutSetPrototypeService, getLayoutSetService, getLayoutTemplateLocalService, getListTypePersistence, getListTypeService, getLockFinder, getLockLocalService, getLockPersistence, getMembershipRequestLocalService, getMembershipRequestPersistence, getMembershipRequestService, getModelClass, getModelClassName, getOrganizationFinder, getOrganizationLocalService, getOrganizationPersistence, getOrganizationService, getOrgGroupPermissionFinder, getOrgGroupPermissionPersistence, getOrgGroupRolePersistence, getOrgLaborLocalService, getOrgLaborPersistence, getOrgLaborService, getPasswordPolicyFinder, getPasswordPolicyLocalService, getPasswordPolicyPersistence, getPasswordPolicyRelLocalService, getPasswordPolicyRelPersistence, getPasswordPolicyService, getPasswordTrackerLocalService, getPasswordTrackerPersistence, getPermission, getPermissionFinder, getPermissionLocalService, getPermissionPersistence, getPermissions, getPermissionsCount, getPermissionService, getPersistedModel, getPhoneLocalService, getPhonePersistence, getPhoneService, getPluginSettingLocalService, getPluginSettingPersistence, getPluginSettingService, getPortalLocalService, getPortalPreferencesLocalService, getPortalPreferencesPersistence, getPortalService, getPortletItemLocalService, getPortletItemPersistence, getPortletLocalService, getPortletPersistence, getPortletPreferencesFinder, getPortletPreferencesLocalService, getPortletPreferencesPersistence, getPortletPreferencesService, getPortletService, getQuartzLocalService, getRegionPersistence, getRegionService, getReleaseLocalService, getReleasePersistence, getRepositoryEntryLocalService, getRepositoryEntryPersistence, getRepositoryLocalService, getRepositoryPersistence, getRepositoryService, getResourceActionLocalService, getResourceActionPersistence, getResourceBlockFinder, getResourceBlockLocalService, getResourceBlockPermissionLocalService, getResourceBlockPermissionPersistence, getResourceBlockPersistence, getResourceBlockService, getResourceCodeLocalService, getResourceCodePersistence, getResourceFinder, getResourceLocalService, getResourcePermissionFinder, getResourcePermissionLocalService, getResourcePermissionPersistence, getResourcePermissionService, getResourcePersistence, getResourceService, getResourceTypePermissionFinder, getResourceTypePermissionLocalService, getResourceTypePermissionPersistence, getRoleFinder, getRoleLocalService, getRolePermissions, getRolePermissions, getRolePermissionsCount, getRolePersistence, getRoleService, getServiceComponentLocalService, getServiceComponentPersistence, getShardLocalService, getShardPersistence, getSubscriptionLocalService, getSubscriptionPersistence, getTeamFinder, getTeamLocalService, getTeamPersistence, getTeamService, getThemeLocalService, getThemeService, getTicketLocalService, getTicketPersistence, getUserFinder, getUserGroupFinder, getUserGroupGroupRoleLocalService, getUserGroupGroupRolePersistence, getUserGroupGroupRoleService, getUserGroupLocalService, getUserGroupPersistence, getUserGroupRoleFinder, getUserGroupRoleLocalService, getUserGroupRolePersistence, getUserGroupRoleService, getUserGroupService, getUserIdMapperLocalService, getUserIdMapperPersistence, getUserLocalService, getUserNotificationEventLocalService, getUserNotificationEventPersistence, getUserPermissions, getUserPermissions, getUserPermissionsCount, getUserPersistence, getUserService, getUserTrackerLocalService, getUserTrackerPathLocalService, getUserTrackerPathPersistence, getUserTrackerPersistence, getVirtualHostLocalService, getVirtualHostPersistence, getWebDAVPropsLocalService, getWebDAVPropsPersistence, getWebsiteLocalService, getWebsitePersistence, getWebsiteService, getWorkflowDefinitionLinkLocalService, getWorkflowDefinitionLinkPersistence, getWorkflowInstanceLinkLocalService, getWorkflowInstanceLinkPersistence, hasGroupPermission, hasGroupPermissions, hasRolePermission, hasRolePermissions, hasUserPermission, hasUserPermissions, runSQL, setAccountLocalService, setAccountPersistence, setAccountService, setAddressLocalService, setAddressPersistence, setAddressService, setBeanIdentifier, setBrowserTrackerLocalService, setBrowserTrackerPersistence, setClassNameLocalService, setClassNamePersistence, setClassNameService, setClusterGroupLocalService, setClusterGroupPersistence, setCMISRepositoryLocalService, setCompanyLocalService, setCompanyPersistence, setCompanyService, setContactLocalService, setContactPersistence, setContactService, setCounterLocalService, setCountryPersistence, setCountryService, setEmailAddressLocalService, setEmailAddressPersistence, setEmailAddressService, setGroupFinder, setGroupLocalService, setGroupPermissions, setGroupPersistence, setGroupService, setImageLocalService, setImagePersistence, setImageService, setLayoutBranchLocalService, setLayoutBranchPersistence, setLayoutBranchService, setLayoutFinder, setLayoutLocalService, setLayoutPersistence, setLayoutPrototypeLocalService, setLayoutPrototypePersistence, setLayoutPrototypeService, setLayoutRevisionLocalService, setLayoutRevisionPersistence, setLayoutRevisionService, setLayoutService, setLayoutSetBranchLocalService, setLayoutSetBranchPersistence, setLayoutSetBranchService, setLayoutSetLocalService, setLayoutSetPersistence, setLayoutSetPrototypeLocalService, setLayoutSetPrototypePersistence, setLayoutSetPrototypeService, setLayoutSetService, setLayoutTemplateLocalService, setListTypePersistence, setListTypeService, setLockFinder, setLockLocalService, setLockPersistence, setMembershipRequestLocalService, setMembershipRequestPersistence, setMembershipRequestService, setOrganizationFinder, setOrganizationLocalService, setOrganizationPersistence, setOrganizationService, setOrgGroupPermissionFinder, setOrgGroupPermissionPersistence, setOrgGroupRolePersistence, setOrgLaborLocalService, setOrgLaborPersistence, setOrgLaborService, setPasswordPolicyFinder, setPasswordPolicyLocalService, setPasswordPolicyPersistence, setPasswordPolicyRelLocalService, setPasswordPolicyRelPersistence, setPasswordPolicyService, setPasswordTrackerLocalService, setPasswordTrackerPersistence, setPermissionFinder, setPermissionLocalService, setPermissionPersistence, setPermissionService, setPhoneLocalService, setPhonePersistence, setPhoneService, setPluginSettingLocalService, setPluginSettingPersistence, setPluginSettingService, setPortalLocalService, setPortalPreferencesLocalService, setPortalPreferencesPersistence, setPortalService, setPortletItemLocalService, setPortletItemPersistence, setPortletLocalService, setPortletPersistence, setPortletPreferencesFinder, setPortletPreferencesLocalService, setPortletPreferencesPersistence, setPortletPreferencesService, setPortletService, setQuartzLocalService, setRegionPersistence, setRegionService, setReleaseLocalService, setReleasePersistence, setRepositoryEntryLocalService, setRepositoryEntryPersistence, setRepositoryLocalService, setRepositoryPersistence, setRepositoryService, setResourceActionLocalService, setResourceActionPersistence, setResourceBlockFinder, setResourceBlockLocalService, setResourceBlockPermissionLocalService, setResourceBlockPermissionPersistence, setResourceBlockPersistence, setResourceBlockService, setResourceCodeLocalService, setResourceCodePersistence, setResourceFinder, setResourceLocalService, setResourcePermissionFinder, setResourcePermissionLocalService, setResourcePermissionPersistence, setResourcePermissionService, setResourcePersistence, setResourceService, setResourceTypePermissionFinder, setResourceTypePermissionLocalService, setResourceTypePermissionPersistence, setRoleFinder, setRoleLocalService, setRolePermissions, setRolePersistence, setRoleService, setServiceComponentLocalService, setServiceComponentPersistence, setShardLocalService, setShardPersistence, setSubscriptionLocalService, setSubscriptionPersistence, setTeamFinder, setTeamLocalService, setTeamPersistence, setTeamService, setThemeLocalService, setThemeService, setTicketLocalService, setTicketPersistence, setUserFinder, setUserGroupFinder, setUserGroupGroupRoleLocalService, setUserGroupGroupRolePersistence, setUserGroupGroupRoleService, setUserGroupLocalService, setUserGroupPersistence, setUserGroupRoleFinder, setUserGroupRoleLocalService, setUserGroupRolePersistence, setUserGroupRoleService, setUserGroupService, setUserIdMapperLocalService, setUserIdMapperPersistence, setUserLocalService, setUserNotificationEventLocalService, setUserNotificationEventPersistence, setUserPermissions, setUserPersistence, setUserService, setUserTrackerLocalService, setUserTrackerPathLocalService, setUserTrackerPathPersistence, setUserTrackerPersistence, setVirtualHostLocalService, setVirtualHostPersistence, setWebDAVPropsLocalService, setWebDAVPropsPersistence, setWebsiteLocalService, setWebsitePersistence, setWebsiteService, setWorkflowDefinitionLinkLocalService, setWorkflowDefinitionLinkPersistence, setWorkflowInstanceLinkLocalService, setWorkflowInstanceLinkPersistence, updatePermission, updatePermission
 
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

PermissionLocalServiceImpl

public PermissionLocalServiceImpl()
Method Detail

addPermission

public Permission addPermission(long companyId,
                                String actionId,
                                long resourceId)
                         throws SystemException
Adds a permission to perform the action on the resource.

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.

Parameters:
companyId - the primary key of the company
actionId - the action's ID
resourceId - the primary key of the resource
Returns:
the permission of the company, action, and resource with the primary keys
Throws:
SystemException - if a system exception occurred

addPermissions

public List<Permission> addPermissions(long companyId,
                                       List<String> actionIds,
                                       long resourceId)
                                throws SystemException
Adds permissions to perform the actions on the resource.

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.

Parameters:
companyId - the primary key of the company
actionIds - the primary keys of the actions
resourceId - the primary key of the resource
Returns:
the permissions to perform the actions on the resource
Throws:
SystemException - if a system exception occurred

addPermissions

public List<Permission> addPermissions(long companyId,
                                       String name,
                                       long resourceId,
                                       boolean portletActions)
                                throws SystemException
Adds permissions to perform either the portlet resource actions or model resource actions on the resource.

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.

Parameters:
companyId - the primary key of the company
name - the resource name
resourceId - the primary key of the resource
portletActions - whether to retrieve the action primary keys from the portlet or the model resource
Returns:
the permissions to perform the actions on the resource
Throws:
SystemException - if a system exception occurred

addUserPermissions

public void addUserPermissions(long userId,
                               String[] actionIds,
                               long resourceId)
                        throws PortalException,
                               SystemException
Adds user permissions to perform the actions on the resource.

Parameters:
userId - the primary key of the user
actionIds - the primary keys of the actions
resourceId - the primary key of the resource
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

checkPermissions

public void checkPermissions(String name,
                             List<String> actionIds)
                      throws PortalException,
                             SystemException
Checks to see if the actions are permitted on the named resource.

Parameters:
name - the resource name
actionIds - the primary keys of the actions
Throws:
PortalException - if the resource company or name could not be found or were invalid
SystemException - if a system exception occurred

getActions

public List<String> getActions(List<Permission> permissions)
Returns the IDs of all the actions belonging to the permissions.

Parameters:
permissions - the permissions
Returns:
the IDs of all the actions belonging to the permissions

getGroupPermissions

public List<Permission> getGroupPermissions(long groupId,
                                            long resourceId)
                                     throws SystemException
Returns all the group's permissions on the resource.

Parameters:
groupId - the primary key of the group
resourceId - the primary key of the resource
Returns:
the group's permissions on the resource
Throws:
SystemException - if a system exception occurred

getGroupPermissions

public List<Permission> getGroupPermissions(long groupId,
                                            long companyId,
                                            String name,
                                            int scope,
                                            String primKey)
                                     throws SystemException
Returns all the group's permissions on the named resource with the scope and primKey.

Parameters:
groupId - the primary key of the group
companyId - the primary key of the company
name - the resource name
scope - the resource scope
primKey - the resource primKey
Returns:
the group's permissions on the named resource with the scope and primKey
Throws:
SystemException - if a system exception occurred

getLatestPermissionId

public long getLatestPermissionId()
                           throws SystemException
Returns the primary key of the latest permission created.

Returns:
the primary key of the latest permission created
Throws:
SystemException - if a system exception occurred

getOrgGroupPermissions

public List<Permission> getOrgGroupPermissions(long organizationId,
                                               long groupId,
                                               long resourceId)
                                        throws SystemException
Returns all the permissions of the organization's group with respect to the resource.

Parameters:
organizationId - the primary key of the organization
groupId - the primary key of the group
resourceId - the primary key of the resource
Returns:
the permissions of the organization's group with respect to the resource
Throws:
SystemException - if a system exception occurred

getPermissions

public List<Permission> getPermissions(long companyId,
                                       String[] actionIds,
                                       long resourceId)
                                throws SystemException
Returns all the permissions to perform the actions on the resource, creating new permissions for any permissions not found.

Parameters:
companyId - the primary key of the company
actionIds - the primary keys of the actions
resourceId - the primary key of the resource
Returns:
the permissions to perform the actions on the resource
Throws:
SystemException - if a system exception occurred
See Also:
addPermission(long, String, long)

getRolePermissions

public List<Permission> getRolePermissions(long roleId)
                                    throws SystemException
Returns all the role's permissions.

Specified by:
getRolePermissions in interface PermissionLocalService
Overrides:
getRolePermissions in class PermissionLocalServiceBaseImpl
Parameters:
roleId - the primary key of the role
Returns:
the role's permissions
Throws:
SystemException - if a system exception occurred

getRolePermissions

public List<Permission> getRolePermissions(long roleId,
                                           int[] scopes)
                                    throws SystemException
Throws:
SystemException

getRolePermissions

public List<Permission> getRolePermissions(long roleId,
                                           long resourceId)
                                    throws SystemException
Returns all the role's permissions on the resource.

Parameters:
roleId - the primary key of the role
resourceId - the primary key of the resource
Returns:
the role's permissions on the resource
Throws:
SystemException - if a system exception occurred

getUserPermissions

public List<Permission> getUserPermissions(long userId)
                                    throws SystemException
Returns all the user's permissions.

Specified by:
getUserPermissions in interface PermissionLocalService
Overrides:
getUserPermissions in class PermissionLocalServiceBaseImpl
Parameters:
userId - the primary key of the user
Returns:
the user's permissions
Throws:
SystemException - if a system exception occurred

getUserPermissions

public List<Permission> getUserPermissions(long userId,
                                           long resourceId)
                                    throws SystemException
Returns all the user's permissions on the resource.

Parameters:
userId - the primary key of the user
resourceId - the primary key of the resource
Returns:
the user's permissions on the resource
Throws:
SystemException - if a system exception occurred

getUserPermissions

public List<Permission> getUserPermissions(long userId,
                                           long companyId,
                                           String name,
                                           int scope,
                                           String primKey)
                                    throws SystemException
Returns all the user's permissions on the named resource with the scope and primKey.

Parameters:
userId - the primary key of the user
companyId - the primary key of the company
name - the resource name
scope - the resource scope
primKey - the resource primKey
Returns:
the user permissions of the resource name, scope, and primKey
Throws:
SystemException - if a system exception occurred

hasGroupPermission

public boolean hasGroupPermission(long groupId,
                                  String actionId,
                                  long resourceId)
                           throws SystemException
Returns true if the group has permission to perform the action on the resource.

Parameters:
groupId - the primary key of the group
actionId - the action's ID
resourceId - the primary key of the resource
Returns:
true if the group has permission to perform the action on the resource; false otherwise
Throws:
SystemException - if a system exception occurred

hasRolePermission

public boolean hasRolePermission(long roleId,
                                 long companyId,
                                 String name,
                                 int scope,
                                 String actionId)
                          throws SystemException
Returns true if the role has permission to perform the action on the named resource with the scope.

Parameters:
roleId - the primary key of the role
companyId - the primary key of the company
name - the resource name
scope - the resource scope
actionId - the action's ID
Returns:
true if the role has permission to perform the action on the named resource with the scope; false otherwise
Throws:
SystemException - if a system exception occurred

hasRolePermission

public boolean hasRolePermission(long roleId,
                                 long companyId,
                                 String name,
                                 int scope,
                                 String primKey,
                                 String actionId)
                          throws SystemException
Returns true if the role has permission to perform the action on the named resource with the scope and primKey.

Parameters:
roleId - the primary key of the role
companyId - the primary key of the company
name - the resource name
scope - the resource scope
primKey - the resource primKey
actionId - the action's ID
Returns:
true if the role has permission to perform the action on the named resource with the scope and primKey; false otherwise
Throws:
SystemException - if a system exception occurred

hasUserPermission

public boolean hasUserPermission(long userId,
                                 String actionId,
                                 long resourceId)
                          throws SystemException
Returns true if the user has permission to perform the action on the resource.

Parameters:
userId - the primary key of the user
actionId - the action's ID
resourceId - the primary key of the resource
Returns:
true if the user has permission to perform the action on the resource; false otherwise
Throws:
SystemException - if a system exception occurred

hasUserPermissions

public boolean hasUserPermissions(long userId,
                                  long groupId,
                                  List<Resource> resources,
                                  String actionId,
                                  PermissionCheckerBag permissionCheckerBag)
                           throws PortalException,
                                  SystemException
Returns 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.

Parameters:
userId - the primary key of the user
groupId - the primary key of the group containing the resource
resources - representations of the resource at each scope level returned by AdvancedPermissionChecker.getResources( long, long, String, String, String)
actionId - the action's ID
permissionCheckerBag - the permission checker bag
Returns:
true if the user has permission to perform the action on the resources; false otherwise
Throws:
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 occurred

setContainerResourcePermissions

public void setContainerResourcePermissions(String name,
                                            String roleName,
                                            String actionId)
                                     throws PortalException,
                                            SystemException
Sets the container wide permissions of either the role or the default user of each company to perform the actions on the named resource.

Parameters:
name - the resource name
roleName - the role name. Supported role names include RoleConstants.ORGANIZATION_USER, RoleConstants.OWNER, and RoleConstants.SITE_MEMBER.
actionId - the action's ID
Throws:
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 occurred

setGroupPermissions

public void setGroupPermissions(long groupId,
                                String[] actionIds,
                                long resourceId)
                         throws PortalException,
                                SystemException
Sets the group's permissions to perform the actions on the resource, replacing the group's existing permissions on the resource.

Parameters:
groupId - the primary key of the group
actionIds - the primary keys of the actions
resourceId - the primary key of the resource
Throws:
PortalException - if a group with the primary key could not be found
SystemException - if a system exception occurred

setGroupPermissions

public void setGroupPermissions(String className,
                                String classPK,
                                long groupId,
                                String[] actionIds,
                                long resourceId)
                         throws PortalException,
                                SystemException
Sets the entity's group permissions to perform the actions on the resource, replacing the entity's existing group permissions on the resource. Only Organization and UserGroup class entities are supported.

Parameters:
className - the class name of an organization or user group
classPK - the primary key of the class
groupId - the primary key of the group
actionIds - the primary keys of the actions
resourceId - the primary key of the resource
Throws:
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 occurred

setOrgGroupPermissions

public void setOrgGroupPermissions(long organizationId,
                                   long groupId,
                                   String[] actionIds,
                                   long resourceId)
                            throws PortalException,
                                   SystemException
Sets the organization's group permissions to perform the actions on the resource, replacing the organization's existing group permissions on the resource.

Parameters:
organizationId - the primary key of the organization
groupId - the primary key of the group in which to scope the permissions
actionIds - the primary keys of the actions
resourceId - the primary key of the resource
Throws:
PortalException - if an organization with the primary key could not be found
SystemException - if a system exception occurred

setRolePermission

public void setRolePermission(long roleId,
                              long companyId,
                              String name,
                              int scope,
                              String primKey,
                              String actionId)
                       throws PortalException,
                              SystemException
Sets the role's permissions to perform the action on the named resource, replacing the role's existing permissions on the resource.

Parameters:
roleId - the primary key of the role
companyId - the primary key of the company
name - the resource name
scope - the resource scope
primKey - the resource primKey
actionId - the action's ID
Throws:
PortalException - if the scope was ResourceConstants.SCOPE_INDIVIDUAL
SystemException - if a system exception occurred

setRolePermissions

public void setRolePermissions(long roleId,
                               long companyId,
                               String name,
                               int scope,
                               String primKey,
                               String[] actionIds)
                        throws PortalException,
                               SystemException
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.

Parameters:
roleId - the primary key of the role
companyId - the primary key of the company
name - the resource name
scope - the resource scope
primKey - the resource primKey
actionIds - the primary keys of the actions
Throws:
PortalException - if the scope was ResourceConstants.SCOPE_INDIVIDUAL
SystemException - if a system exception occurred

setRolePermissions

public void setRolePermissions(long roleId,
                               String[] actionIds,
                               long resourceId)
                        throws PortalException,
                               SystemException
Sets the role's permissions to perform the actions on the resource, replacing the role's existing permissions on the resource.

Parameters:
roleId - the primary key of the role
actionIds - the primary keys of the actions
resourceId - the primary key of the resource
Throws:
PortalException - if a role with the primary key could not be found
SystemException - if a system exception occurred

setRolesPermissions

public void setRolesPermissions(long companyId,
                                Map<Long,String[]> roleIdsToActionIds,
                                long resourceId)
                         throws SystemException
Sets the permissions of each role to perform respective actions on the resource, replacing the existing permissions of each role on the resource.

Parameters:
companyId - the primary key of the company
roleIdsToActionIds - the map of roles to their new actions on the resource
resourceId - the primary key of the resource
Throws:
SystemException - if a system exception occurred

setRolesPermissions

public void setRolesPermissions(long companyId,
                                Map<Long,String[]> roleIdsToActionIds,
                                String name,
                                int scope,
                                String primKey)
                         throws SystemException
Sets the permissions of each role to perform respective actions on the named resource, replacing the existing permissions of each role on the resource.

Parameters:
companyId - the primary key of the company
roleIdsToActionIds - the map of roles to their new actions on the resource
name - the resource name
scope - the resource scope
primKey - the resource primKey
Throws:
SystemException - if a system exception occurred

setUserPermissions

public void setUserPermissions(long userId,
                               String[] actionIds,
                               long resourceId)
                        throws PortalException,
                               SystemException
Sets the user's permissions to perform the actions on the resource, replacing the user's existing permissions on the resource.

Parameters:
userId - the primary key of the user
actionIds - the primary keys of the actions
resourceId - the primary key of the resource
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

unsetRolePermission

public void unsetRolePermission(long roleId,
                                long permissionId)
                         throws SystemException
Removes the permission from the role.

Parameters:
roleId - the primary key of the role
permissionId - the primary key of the permission
Throws:
SystemException - if a system exception occurred

unsetRolePermission

public void unsetRolePermission(long roleId,
                                long companyId,
                                String name,
                                int scope,
                                String primKey,
                                String actionId)
                         throws SystemException
Removes the role's permissions to perform the action on the named resource with the scope and primKey.

Parameters:
roleId - the primary key of the role
companyId - the primary key of the company
name - the resource name
scope - the resource scope
primKey - the resource primKey
actionId - the action's ID
Throws:
SystemException - if a system exception occurred

unsetRolePermissions

public void unsetRolePermissions(long roleId,
                                 long companyId,
                                 String name,
                                 int scope,
                                 String actionId)
                          throws SystemException
Removes the role's permissions to perform the action on the named resource.

Parameters:
roleId - the primary key of the role
companyId - the primary key of the company
name - the resource name
scope - the resource scope
actionId - the action's ID
Throws:
SystemException - if a system exception occurred

unsetUserPermissions

public void unsetUserPermissions(long userId,
                                 String[] actionIds,
                                 long resourceId)
                          throws SystemException
Removes the user's permissions to perform the actions on the resource.

Parameters:
userId - the primary key of the user
actionIds - the primary keys of the actions
resourceId - the primary key of the resource
Throws:
SystemException - if a system exception occurred

checkOrgGroupPermission

protected boolean checkOrgGroupPermission(List<Organization> organizations,
                                          List<Group> groups,
                                          List<Permission> permissions)
                                   throws PortalException,
                                          SystemException
Throws:
PortalException
SystemException

checkOrgGroupPermission

protected boolean checkOrgGroupPermission(List<Organization> organizations,
                                          List<Group> groups,
                                          Permission permission)
                                   throws PortalException,
                                          SystemException
Throws:
PortalException
SystemException

hasUserPermissions_1

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
Throws:
SystemException

hasUserPermissions_2

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
Throws:
SystemException

hasUserPermissions_3

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
Throws:
SystemException

hasUserPermissions_4

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
Throws:
SystemException

hasUserPermissions_5

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
Throws:
SystemException

hasUserPermissions_6

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
Throws:
PortalException
SystemException

logHasUserPermissions

protected void logHasUserPermissions(long userId,
                                     long resourceId,
                                     String actionId,
                                     org.apache.commons.lang.time.StopWatch stopWatch,
                                     int block)

setContainerResourcePermissions

protected void setContainerResourcePermissions(long companyId,
                                               String name,
                                               String roleName,
                                               String actionId)
                                        throws PortalException,
                                               SystemException
Throws:
PortalException
SystemException

Liferay 6.1.2-ce-ga3