Liferay 6.0.5

com.liferay.portal.service
Class PermissionLocalServiceUtil

java.lang.Object
  extended by com.liferay.portal.service.PermissionLocalServiceUtil

public class PermissionLocalServiceUtil
extends Object

The utility for the permission local service. This utility wraps PermissionLocalServiceImpl and is the primary access point for service operations in application layer code running on the local server.

Never modify this class directly. Add custom service methods to PermissionLocalServiceImpl and rerun ServiceBuilder to regenerate this class.

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:
PermissionLocalService, PermissionLocalServiceBaseImpl, PermissionLocalServiceImpl
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time is generated.

Constructor Summary
PermissionLocalServiceUtil()
           
 
Method Summary
static Permission addPermission(long companyId, String actionId, long resourceId)
           
static Permission addPermission(Permission permission)
          Adds the permission to the database.
static List<Permission> addPermissions(long companyId, List<String> actionIds, long resourceId)
           
static List<Permission> addPermissions(long companyId, String name, long resourceId, boolean portletActions)
           
static void addUserPermissions(long userId, String[] actionIds, long resourceId)
           
static Permission createPermission(long permissionId)
          Creates a new permission with the primary key.
static void deletePermission(long permissionId)
          Deletes the permission with the primary key from the database.
static void deletePermission(Permission permission)
          Deletes the permission from the database.
static List dynamicQuery(DynamicQuery dynamicQuery)
          Performs a dynamic query on the database and returns the matching rows.
static List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
          Performs a dynamic query on the database and returns a range of the matching rows.
static 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.
static long dynamicQueryCount(DynamicQuery dynamicQuery)
          Counts the number of rows that match the dynamic query.
static List<String> getActions(List<Permission> permissions)
           
static List<Permission> getGroupPermissions(long groupId, long resourceId)
           
static List<Permission> getGroupPermissions(long groupId, long companyId, String name, int scope, String primKey)
           
static long getLatestPermissionId()
           
static List<Permission> getOrgGroupPermissions(long organizationId, long groupId, long resourceId)
           
static Permission getPermission(long permissionId)
          Gets the permission with the primary key.
static List<Permission> getPermissions(int start, int end)
          Gets a range of all the permissions.
static List<Permission> getPermissions(long companyId, String[] actionIds, long resourceId)
           
static int getPermissionsCount()
          Gets the number of permissions.
static List<Permission> getRolePermissions(long roleId)
           
static List<Permission> getRolePermissions(long roleId, long resourceId)
           
static PermissionLocalService getService()
           
static List<Permission> getUserPermissions(long userId, long resourceId)
           
static List<Permission> getUserPermissions(long userId, long companyId, String name, int scope, String primKey)
           
static boolean hasGroupPermission(long groupId, String actionId, long resourceId)
           
static boolean hasRolePermission(long roleId, long companyId, String name, int scope, String actionId)
           
static boolean hasRolePermission(long roleId, long companyId, String name, int scope, String primKey, String actionId)
           
static boolean hasUserPermission(long userId, String actionId, long resourceId)
           
static boolean hasUserPermissions(long userId, long groupId, List<Resource> resources, String actionId, PermissionCheckerBag permissionCheckerBag)
           
static void setGroupPermissions(long groupId, String[] actionIds, long resourceId)
           
static void setGroupPermissions(String className, String classPK, long groupId, String[] actionIds, long resourceId)
           
static void setOrgGroupPermissions(long organizationId, long groupId, String[] actionIds, long resourceId)
           
static void setRolePermission(long roleId, long companyId, String name, int scope, String primKey, String actionId)
           
static void setRolePermissions(long roleId, long companyId, String name, int scope, String primKey, String[] actionIds)
           
static void setRolePermissions(long roleId, String[] actionIds, long resourceId)
           
 void setService(PermissionLocalService service)
           
static void setUserPermissions(long userId, String[] actionIds, long resourceId)
           
static void unsetRolePermission(long roleId, long permissionId)
           
static void unsetRolePermission(long roleId, long companyId, String name, int scope, String primKey, String actionId)
           
static void unsetRolePermissions(long roleId, long companyId, String name, int scope, String actionId)
           
static void unsetUserPermissions(long userId, String[] actionIds, long resourceId)
           
static Permission updatePermission(Permission permission)
          Updates the permission in the database.
static Permission updatePermission(Permission permission, boolean merge)
          Updates the permission in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionLocalServiceUtil

public PermissionLocalServiceUtil()
Method Detail

addPermission

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

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

createPermission

public static 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

public static 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 to delete
Throws:
PortalException - if a permission with the primary key could not be found
SystemException - if a system exception occurred

deletePermission

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

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

dynamicQuery

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

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

dynamicQuery

public static 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 to search with
start - the lower bound of the range of model instances to return
end - the upper bound of the range of model instances to return (not inclusive)
Returns:
the range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

public static 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 to search with
start - the lower bound of the range of model instances to return
end - the upper bound of the range of model instances to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQueryCount

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

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

getPermission

public static Permission getPermission(long permissionId)
                                throws PortalException,
                                       SystemException
Gets the permission with the primary key.

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

getPermissions

public static List<Permission> getPermissions(int start,
                                              int end)
                                       throws SystemException
Gets 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 to return
end - the upper bound of the range of permissions to return (not inclusive)
Returns:
the range of permissions
Throws:
SystemException - if a system exception occurred

getPermissionsCount

public static int getPermissionsCount()
                               throws SystemException
Gets the number of permissions.

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

updatePermission

public static Permission updatePermission(Permission permission)
                                   throws SystemException
Updates the permission in the database. Also notifies the appropriate model listeners.

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

updatePermission

public static Permission updatePermission(Permission permission,
                                          boolean merge)
                                   throws SystemException
Updates the permission in the database. Also notifies the appropriate model listeners.

Parameters:
permission - the permission to update
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

addPermission

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

addPermissions

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

addPermissions

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

addUserPermissions

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

getActions

public static List<String> getActions(List<Permission> permissions)

getGroupPermissions

public static List<Permission> getGroupPermissions(long groupId,
                                                   long resourceId)
                                            throws SystemException
Throws:
SystemException

getGroupPermissions

public static List<Permission> getGroupPermissions(long groupId,
                                                   long companyId,
                                                   String name,
                                                   int scope,
                                                   String primKey)
                                            throws SystemException
Throws:
SystemException

getOrgGroupPermissions

public static List<Permission> getOrgGroupPermissions(long organizationId,
                                                      long groupId,
                                                      long resourceId)
                                               throws SystemException
Throws:
SystemException

getLatestPermissionId

public static long getLatestPermissionId()
                                  throws SystemException
Throws:
SystemException

getPermissions

public static List<Permission> getPermissions(long companyId,
                                              String[] actionIds,
                                              long resourceId)
                                       throws SystemException
Throws:
SystemException

getRolePermissions

public static List<Permission> getRolePermissions(long roleId)
                                           throws SystemException
Throws:
SystemException

getRolePermissions

public static List<Permission> getRolePermissions(long roleId,
                                                  long resourceId)
                                           throws SystemException
Throws:
SystemException

getUserPermissions

public static List<Permission> getUserPermissions(long userId,
                                                  long resourceId)
                                           throws SystemException
Throws:
SystemException

getUserPermissions

public static List<Permission> getUserPermissions(long userId,
                                                  long companyId,
                                                  String name,
                                                  int scope,
                                                  String primKey)
                                           throws SystemException
Throws:
SystemException

hasGroupPermission

public static boolean hasGroupPermission(long groupId,
                                         String actionId,
                                         long resourceId)
                                  throws SystemException
Throws:
SystemException

hasRolePermission

public static boolean hasRolePermission(long roleId,
                                        long companyId,
                                        String name,
                                        int scope,
                                        String actionId)
                                 throws SystemException
Throws:
SystemException

hasRolePermission

public static boolean hasRolePermission(long roleId,
                                        long companyId,
                                        String name,
                                        int scope,
                                        String primKey,
                                        String actionId)
                                 throws SystemException
Throws:
SystemException

hasUserPermission

public static boolean hasUserPermission(long userId,
                                        String actionId,
                                        long resourceId)
                                 throws SystemException
Throws:
SystemException

hasUserPermissions

public static boolean hasUserPermissions(long userId,
                                         long groupId,
                                         List<Resource> resources,
                                         String actionId,
                                         PermissionCheckerBag permissionCheckerBag)
                                  throws PortalException,
                                         SystemException
Throws:
PortalException
SystemException

setGroupPermissions

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

setGroupPermissions

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

setOrgGroupPermissions

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

setRolePermission

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

setRolePermissions

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

setRolePermissions

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

setUserPermissions

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

unsetRolePermission

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

unsetRolePermission

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

unsetRolePermissions

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

unsetUserPermissions

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

getService

public static PermissionLocalService getService()

setService

public void setService(PermissionLocalService service)

Liferay 6.0.5