All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.liferay.portal.service.RoleServiceUtil Maven / Gradle / Ivy

Go to download

Contains interfaces for the portal services. Interfaces are only loaded by the global class loader and are shared by all plugins.

There is a newer version: 7.0.0-nightly
Show newest version
/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.liferay.portal.service;

import aQute.bnd.annotation.ProviderType;

import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
import com.liferay.portal.kernel.util.ReferenceRegistry;

/**
 * Provides the remote service utility for Role. This utility wraps
 * {@link com.liferay.portal.service.impl.RoleServiceImpl} and is the
 * primary access point for service operations in application layer code running
 * on a remote server. Methods of this service are expected to have security
 * checks based on the propagated JAAS credentials because this service can be
 * accessed remotely.
 *
 * @author Brian Wing Shun Chan
 * @see RoleService
 * @see com.liferay.portal.service.base.RoleServiceBaseImpl
 * @see com.liferay.portal.service.impl.RoleServiceImpl
 * @generated
 */
@ProviderType
public class RoleServiceUtil {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.RoleServiceImpl} and rerun ServiceBuilder to regenerate this class.
	 */

	/**
	* Returns the Spring bean ID for this bean.
	*
	* @return the Spring bean ID for this bean
	*/
	public static java.lang.String getBeanIdentifier() {
		return getService().getBeanIdentifier();
	}

	/**
	* Sets the Spring bean ID for this bean.
	*
	* @param beanIdentifier the Spring bean ID for this bean
	*/
	public static void setBeanIdentifier(java.lang.String beanIdentifier) {
		getService().setBeanIdentifier(beanIdentifier);
	}

	/**
	* Adds a role. The user is reindexed after role is added.
	*
	* @param className the name of the class for which the role is created
	* @param classPK the primary key of the class for which the role is
	created (optionally 0)
	* @param name the role's name
	* @param titleMap the role's localized titles (optionally
	null)
	* @param descriptionMap the role's localized descriptions (optionally
	null)
	* @param type the role's type (optionally 0)
	* @param subtype the role's subtype (optionally null)
	* @param serviceContext the service context to be applied (optionally
	null). Can set the expando bridge attributes for the
	role.
	* @return the role
	* @throws PortalException if a user with the primary key could not be
	found, if the user did not have permission to add roles, if the
	class name or the role name were invalid, or if the role is a
	duplicate
	* @throws SystemException if a system exception occurred
	*/
	public static com.liferay.portal.model.Role addRole(
		java.lang.String className, long classPK, java.lang.String name,
		java.util.Map titleMap,
		java.util.Map descriptionMap,
		int type, java.lang.String subtype,
		com.liferay.portal.service.ServiceContext serviceContext)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService()
				   .addRole(className, classPK, name, titleMap, descriptionMap,
			type, subtype, serviceContext);
	}

	/**
	* Adds a role. The user is reindexed after role is added.
	*
	* @param name the role's name
	* @param titleMap the role's localized titles (optionally
	null)
	* @param descriptionMap the role's localized descriptions (optionally
	null)
	* @param type the role's type (optionally 0)
	* @return the role
	* @throws PortalException if a user with the primary key could not be
	found, if the user did not have permission to add roles, if
	the class name or the role name were invalid, or if the role
	is a duplicate
	* @throws SystemException if a system exception occurred
	* @deprecated As of 6.2.0, replaced by {@link #addRole(String, long,
	String, Map, Map, int, String, ServiceContext)}
	*/
	public static com.liferay.portal.model.Role addRole(java.lang.String name,
		java.util.Map titleMap,
		java.util.Map descriptionMap,
		int type)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService().addRole(name, titleMap, descriptionMap, type);
	}

	/**
	* Adds the roles to the user. The user is reindexed after the roles are
	* added.
	*
	* @param userId the primary key of the user
	* @param roleIds the primary keys of the roles
	* @throws PortalException if a user with the primary key could not be found
	or if the user did not have permission to assign members to one
	of the roles
	* @throws SystemException if a system exception occurred
	*/
	public static void addUserRoles(long userId, long[] roleIds)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		getService().addUserRoles(userId, roleIds);
	}

	/**
	* Deletes the role with the primary key and its associated permissions.
	*
	* @param roleId the primary key of the role
	* @throws PortalException if the user did not have permission to delete the
	role, if a role with the primary key could not be found, if the
	role is a default system role, or if the role's resource could
	not be found
	* @throws SystemException if a system exception occurred
	*/
	public static void deleteRole(long roleId)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		getService().deleteRole(roleId);
	}

	/**
	* Returns all the roles associated with the group.
	*
	* @param groupId the primary key of the group
	* @return the roles associated with the group
	* @throws PortalException if a portal exception occurred
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List getGroupRoles(
		long groupId)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService().getGroupRoles(groupId);
	}

	/**
	* Returns the role with the primary key.
	*
	* @param roleId the primary key of the role
	* @return the role with the primary key
	* @throws PortalException if a role with the primary key could not be found
	or if the user did not have permission to view the role
	* @throws SystemException if a system exception occurred
	*/
	public static com.liferay.portal.model.Role getRole(long roleId)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService().getRole(roleId);
	}

	/**
	* Returns the role with the name in the company.
	*
	* 

* The method searches the system roles map first for default roles. If a * role with the name is not found, then the method will query the database. *

* * @param companyId the primary key of the company * @param name the role's name * @return the role with the name * @throws PortalException if a role with the name could not be found in the company or if the user did not have permission to view the role * @throws SystemException if a system exception occurred */ public static com.liferay.portal.model.Role getRole(long companyId, java.lang.String name) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { return getService().getRole(companyId, name); } /** * Returns all the user's roles within the user group. * * @param userId the primary key of the user * @param groupId the primary key of the group * @return the user's roles within the user group * @throws PortalException if a portal exception occurred * @throws SystemException if a system exception occurred */ public static java.util.List getUserGroupGroupRoles( long userId, long groupId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { return getService().getUserGroupGroupRoles(userId, groupId); } /** * Returns all the user's roles within the user group. * * @param userId the primary key of the user * @param groupId the primary key of the group * @return the user's roles within the user group * @throws PortalException if a portal exception occurred * @throws SystemException if a system exception occurred */ public static java.util.List getUserGroupRoles( long userId, long groupId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { return getService().getUserGroupRoles(userId, groupId); } /** * Returns the union of all the user's roles within the groups. * * @param userId the primary key of the user * @param groups the groups (optionally null) * @return the union of all the user's roles within the groups * @throws PortalException if a portal exception occurred * @throws SystemException if a system exception occurred */ public static java.util.List getUserRelatedRoles( long userId, java.util.List groups) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { return getService().getUserRelatedRoles(userId, groups); } /** * Returns all the roles associated with the user. * * @param userId the primary key of the user * @return the roles associated with the user * @throws PortalException if a portal exception occurred * @throws SystemException if a system exception occurred */ public static java.util.List getUserRoles( long userId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { return getService().getUserRoles(userId); } /** * Returns true if the user is associated with the named * regular role. * * @param userId the primary key of the user * @param companyId the primary key of the company * @param name the name of the role * @param inherited whether to include the user's inherited roles in the search * @return true if the user is associated with the regular role; false otherwise * @throws PortalException if a role with the name could not be found in the company or if a default user for the company could not be found * @throws SystemException if a system exception occurred */ public static boolean hasUserRole(long userId, long companyId, java.lang.String name, boolean inherited) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { return getService().hasUserRole(userId, companyId, name, inherited); } /** * Returns true if the user has any one of the named regular * roles. * * @param userId the primary key of the user * @param companyId the primary key of the company * @param names the names of the roles * @param inherited whether to include the user's inherited roles in the search * @return true if the user has any one of the regular roles; false otherwise * @throws PortalException if any one of the roles with the names could not be found in the company or if the default user for the company could not be found * @throws SystemException if a system exception occurred */ public static boolean hasUserRoles(long userId, long companyId, java.lang.String[] names, boolean inherited) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { return getService().hasUserRoles(userId, companyId, names, inherited); } /** * Removes the matching roles associated with the user. The user is * reindexed after the roles are removed. * * @param userId the primary key of the user * @param roleIds the primary keys of the roles * @throws PortalException if a user with the primary key could not be found, if the user did not have permission to remove members from a role, or if a role with any one of the primary keys could not be found * @throws SystemException if a system exception occurred */ public static void unsetUserRoles(long userId, long[] roleIds) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { getService().unsetUserRoles(userId, roleIds); } /** * Updates the role with the primary key. * * @param roleId the primary key of the role * @param name the role's new name * @param titleMap the new localized titles (optionally null) to replace those existing for the role * @param descriptionMap the new localized descriptions (optionally null) to replace those existing for the role * @param subtype the role's new subtype (optionally null) * @param serviceContext the service context to be applied (optionally null). Can set the expando bridge attributes for the role. * @return the role with the primary key * @throws PortalException if the user did not have permission to update the role, if a role with the primary could not be found, or if the role's name was invalid * @throws SystemException if a system exception occurred */ public static com.liferay.portal.model.Role updateRole(long roleId, java.lang.String name, java.util.Map titleMap, java.util.Map descriptionMap, java.lang.String subtype, com.liferay.portal.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { return getService() .updateRole(roleId, name, titleMap, descriptionMap, subtype, serviceContext); } public static RoleService getService() { if (_service == null) { _service = (RoleService)PortalBeanLocatorUtil.locate(RoleService.class.getName()); ReferenceRegistry.registerReference(RoleServiceUtil.class, "_service"); } return _service; } /** * @deprecated As of 6.2.0 */ public void setService(RoleService service) { } private static RoleService _service; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy