Liferay 6.0-ee-sp2

com.liferay.portal.service
Interface PermissionLocalService

All Superinterfaces:
PersistedModelLocalService
All Known Implementing Classes:
PermissionLocalServiceWrapper

@Transactional(isolation=PORTAL,
               rollbackFor={PortalException.class,SystemException.class})
public interface PermissionLocalService
extends PersistedModelLocalService

The interface for the permission local service.

This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.

See Also:
PermissionLocalServiceUtil, PermissionLocalServiceBaseImpl, com.liferay.portal.service.impl.PermissionLocalServiceImpl

Method Summary
 Permission addPermission(long companyId, String actionId, long resourceId)
           
 Permission addPermission(Permission permission)
          Adds the permission to the database.
 List<Permission> addPermissions(long companyId, List<String> actionIds, long resourceId)
           
 List<Permission> addPermissions(long companyId, String name, long resourceId, boolean portletActions)
           
 void addUserPermissions(long userId, String[] actionIds, long resourceId)
           
 void checkPermissions(String name, List<String> actionIds)
           
 Permission createPermission(long permissionId)
          Creates a new permission with the primary key.
 void deletePermission(long permissionId)
          Deletes the permission with the primary key from the database.
 void deletePermission(Permission permission)
          Deletes the permission from the database.
 List dynamicQuery(DynamicQuery dynamicQuery)
          Performs a dynamic query on the database and returns the matching rows.
 List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
          Performs a dynamic query on the database and returns a range of the matching rows.
 List dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
          Performs a dynamic query on the database and returns an ordered range of the matching rows.
 long dynamicQueryCount(DynamicQuery dynamicQuery)
          Returns the number of rows that match the dynamic query.
 List<String> getActions(List<Permission> permissions)
           
 String getBeanIdentifier()
          Returns the Spring bean ID for this bean.
 List<Permission> getGroupPermissions(long groupId, long resourceId)
           
 List<Permission> getGroupPermissions(long groupId, long companyId, String name, int scope, String primKey)
           
 long getLatestPermissionId()
           
 List<Permission> getOrgGroupPermissions(long organizationId, long groupId, long resourceId)
           
 Permission getPermission(long permissionId)
          Returns the permission with the primary key.
 List<Permission> getPermissions(int start, int end)
          Returns a range of all the permissions.
 List<Permission> getPermissions(long companyId, String[] actionIds, long resourceId)
           
 int getPermissionsCount()
          Returns the number of permissions.
 PersistedModel getPersistedModel(Serializable primaryKeyObj)
           
 List<Permission> getRolePermissions(long roleId)
           
 List<Permission> getRolePermissions(long roleId, long resourceId)
           
 List<Permission> getUserPermissions(long userId, long resourceId)
           
 List<Permission> getUserPermissions(long userId, long companyId, String name, int scope, String primKey)
           
 boolean hasGroupPermission(long groupId, String actionId, long resourceId)
           
 boolean hasRolePermission(long roleId, long companyId, String name, int scope, String actionId)
           
 boolean hasRolePermission(long roleId, long companyId, String name, int scope, String primKey, String actionId)
           
 boolean hasUserPermission(long userId, String actionId, long resourceId)
           
 boolean hasUserPermissions(long userId, long groupId, List<Resource> resources, String actionId, PermissionCheckerBag permissionCheckerBag)
           
 void setBeanIdentifier(String beanIdentifier)
          Sets the Spring bean ID for this bean.
 void setContainerResourcePermissions(String name, String roleName, String actionId)
           
 void setGroupPermissions(long groupId, String[] actionIds, long resourceId)
           
 void setGroupPermissions(String className, String classPK, long groupId, String[] actionIds, long resourceId)
           
 void setOrgGroupPermissions(long organizationId, long groupId, String[] actionIds, long resourceId)
           
 void setRolePermission(long roleId, long companyId, String name, int scope, String primKey, String actionId)
           
 void setRolePermissions(long roleId, long companyId, String name, int scope, String primKey, String[] actionIds)
           
 void setRolePermissions(long roleId, String[] actionIds, long resourceId)
           
 void setUserPermissions(long userId, String[] actionIds, long resourceId)
           
 void unsetRolePermission(long roleId, long permissionId)
           
 void unsetRolePermission(long roleId, long companyId, String name, int scope, String primKey, String actionId)
           
 void unsetRolePermissions(long roleId, long companyId, String name, int scope, String actionId)
           
 void unsetUserPermissions(long userId, String[] actionIds, long resourceId)
           
 Permission updatePermission(Permission permission)
          Updates the permission in the database or adds it if it does not yet exist.
 Permission updatePermission(Permission permission, boolean merge)
          Updates the permission in the database or adds it if it does not yet exist.
 

Method Detail

addPermission

Permission addPermission(Permission permission)
                         throws SystemException
Adds the permission to the database. Also notifies the appropriate model listeners.

Parameters:
permission - the permission
Returns:
the permission that was added
Throws:
SystemException - if a system exception occurred

createPermission

Permission createPermission(long permissionId)
Creates a new permission with the primary key. Does not add the permission to the database.

Parameters:
permissionId - the primary key for the new permission
Returns:
the new permission

deletePermission

void deletePermission(long permissionId)
                      throws PortalException,
                             SystemException
Deletes the permission with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
permissionId - the primary key of the permission
Throws:
PortalException - if a permission with the primary key could not be found
SystemException - if a system exception occurred

deletePermission

void deletePermission(Permission permission)
                      throws SystemException
Deletes the permission from the database. Also notifies the appropriate model listeners.

Parameters:
permission - the permission
Throws:
SystemException - if a system exception occurred

dynamicQuery

List dynamicQuery(DynamicQuery dynamicQuery)
                  throws SystemException
Performs a dynamic query on the database and returns the matching rows.

Parameters:
dynamicQuery - the dynamic query
Returns:
the matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

List dynamicQuery(DynamicQuery dynamicQuery,
                  int start,
                  int end)
                  throws SystemException
Performs a dynamic query on the database and returns a range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
Returns:
the range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

List dynamicQuery(DynamicQuery dynamicQuery,
                  int start,
                  int end,
                  OrderByComparator orderByComparator)
                  throws SystemException
Performs a dynamic query on the database and returns an ordered range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQueryCount

long dynamicQueryCount(DynamicQuery dynamicQuery)
                       throws SystemException
Returns the number of rows that match the dynamic query.

Parameters:
dynamicQuery - the dynamic query
Returns:
the number of rows that match the dynamic query
Throws:
SystemException - if a system exception occurred

getPermission

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Permission getPermission(long permissionId)
                         throws PortalException,
                                SystemException
Returns the permission with the primary key.

Parameters:
permissionId - the primary key of the permission
Returns:
the permission
Throws:
PortalException - if a permission with the primary key could not be found
SystemException - if a system exception occurred

getPersistedModel

@Transactional(propagation=SUPPORTS,
               readOnly=true)
PersistedModel getPersistedModel(Serializable primaryKeyObj)
                                 throws PortalException,
                                        SystemException
Specified by:
getPersistedModel in interface PersistedModelLocalService
Throws:
PortalException
SystemException

getPermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Permission> getPermissions(int start,
                                                                         int end)
                                throws SystemException
Returns a range of all the permissions.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of permissions
end - the upper bound of the range of permissions (not inclusive)
Returns:
the range of permissions
Throws:
SystemException - if a system exception occurred

getPermissionsCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getPermissionsCount()
                        throws SystemException
Returns the number of permissions.

Returns:
the number of permissions
Throws:
SystemException - if a system exception occurred

updatePermission

Permission updatePermission(Permission permission)
                            throws SystemException
Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
permission - the permission
Returns:
the permission that was updated
Throws:
SystemException - if a system exception occurred

updatePermission

Permission updatePermission(Permission permission,
                            boolean merge)
                            throws SystemException
Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
permission - the permission
merge - whether to merge the permission with the current session. See BatchSession.update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean) for an explanation.
Returns:
the permission that was updated
Throws:
SystemException - if a system exception occurred

getBeanIdentifier

String getBeanIdentifier()
Returns the Spring bean ID for this bean.

Returns:
the Spring bean ID for this bean

setBeanIdentifier

void setBeanIdentifier(String beanIdentifier)
Sets the Spring bean ID for this bean.

Parameters:
beanIdentifier - the Spring bean ID for this bean

addPermission

Permission addPermission(long companyId,
                         String actionId,
                         long resourceId)
                         throws SystemException
Throws:
SystemException

addPermissions

List<Permission> addPermissions(long companyId,
                                List<String> actionIds,
                                long resourceId)
                                throws SystemException
Throws:
SystemException

addPermissions

List<Permission> addPermissions(long companyId,
                                String name,
                                long resourceId,
                                boolean portletActions)
                                throws SystemException
Throws:
SystemException

addUserPermissions

void addUserPermissions(long userId,
                        String[] actionIds,
                        long resourceId)
                        throws PortalException,
                               SystemException
Throws:
PortalException
SystemException

checkPermissions

void checkPermissions(String name,
                      List<String> actionIds)
                      throws PortalException,
                             SystemException
Throws:
PortalException
SystemException

getActions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<String> getActions(List<Permission> permissions)

getGroupPermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Permission> getGroupPermissions(long groupId,
                                                                              long resourceId)
                                     throws SystemException
Throws:
SystemException

getGroupPermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Permission> getGroupPermissions(long groupId,
                                                                              long companyId,
                                                                              String name,
                                                                              int scope,
                                                                              String primKey)
                                     throws SystemException
Throws:
SystemException

getLatestPermissionId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
long getLatestPermissionId()
                           throws SystemException
Throws:
SystemException

getOrgGroupPermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Permission> getOrgGroupPermissions(long organizationId,
                                                                                 long groupId,
                                                                                 long resourceId)
                                        throws SystemException
Throws:
SystemException

getPermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Permission> getPermissions(long companyId,
                                                                         String[] actionIds,
                                                                         long resourceId)
                                throws SystemException
Throws:
SystemException

getRolePermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Permission> getRolePermissions(long roleId)
                                    throws SystemException
Throws:
SystemException

getRolePermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Permission> getRolePermissions(long roleId,
                                                                             long resourceId)
                                    throws SystemException
Throws:
SystemException

getUserPermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Permission> getUserPermissions(long userId,
                                                                             long resourceId)
                                    throws SystemException
Throws:
SystemException

getUserPermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Permission> getUserPermissions(long userId,
                                                                             long companyId,
                                                                             String name,
                                                                             int scope,
                                                                             String primKey)
                                    throws SystemException
Throws:
SystemException

hasGroupPermission

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasGroupPermission(long groupId,
                                                                    String actionId,
                                                                    long resourceId)
                           throws SystemException
Throws:
SystemException

hasRolePermission

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasRolePermission(long roleId,
                                                                   long companyId,
                                                                   String name,
                                                                   int scope,
                                                                   String actionId)
                          throws SystemException
Throws:
SystemException

hasRolePermission

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasRolePermission(long roleId,
                                                                   long companyId,
                                                                   String name,
                                                                   int scope,
                                                                   String primKey,
                                                                   String actionId)
                          throws SystemException
Throws:
SystemException

hasUserPermission

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasUserPermission(long userId,
                                                                   String actionId,
                                                                   long resourceId)
                          throws SystemException
Throws:
SystemException

hasUserPermissions

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasUserPermissions(long userId,
                                                                    long groupId,
                                                                    List<Resource> resources,
                                                                    String actionId,
                                                                    PermissionCheckerBag permissionCheckerBag)
                           throws PortalException,
                                  SystemException
Throws:
PortalException
SystemException

setContainerResourcePermissions

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

setGroupPermissions

void setGroupPermissions(long groupId,
                         String[] actionIds,
                         long resourceId)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

setGroupPermissions

void setGroupPermissions(String className,
                         String classPK,
                         long groupId,
                         String[] actionIds,
                         long resourceId)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

setOrgGroupPermissions

void setOrgGroupPermissions(long organizationId,
                            long groupId,
                            String[] actionIds,
                            long resourceId)
                            throws PortalException,
                                   SystemException
Throws:
PortalException
SystemException

setRolePermission

void setRolePermission(long roleId,
                       long companyId,
                       String name,
                       int scope,
                       String primKey,
                       String actionId)
                       throws PortalException,
                              SystemException
Throws:
PortalException
SystemException

setRolePermissions

void setRolePermissions(long roleId,
                        long companyId,
                        String name,
                        int scope,
                        String primKey,
                        String[] actionIds)
                        throws PortalException,
                               SystemException
Throws:
PortalException
SystemException

setRolePermissions

void setRolePermissions(long roleId,
                        String[] actionIds,
                        long resourceId)
                        throws PortalException,
                               SystemException
Throws:
PortalException
SystemException

setUserPermissions

void setUserPermissions(long userId,
                        String[] actionIds,
                        long resourceId)
                        throws PortalException,
                               SystemException
Throws:
PortalException
SystemException

unsetRolePermission

void unsetRolePermission(long roleId,
                         long permissionId)
                         throws SystemException
Throws:
SystemException

unsetRolePermission

void unsetRolePermission(long roleId,
                         long companyId,
                         String name,
                         int scope,
                         String primKey,
                         String actionId)
                         throws SystemException
Throws:
SystemException

unsetRolePermissions

void unsetRolePermissions(long roleId,
                          long companyId,
                          String name,
                          int scope,
                          String actionId)
                          throws SystemException
Throws:
SystemException

unsetUserPermissions

void unsetUserPermissions(long userId,
                          String[] actionIds,
                          long resourceId)
                          throws SystemException
Throws:
SystemException

Liferay 6.0-ee-sp2