001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
022    import com.liferay.portal.kernel.security.access.control.AccessControlled;
023    import com.liferay.portal.kernel.transaction.Isolation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    
026    /**
027     * Provides the remote service interface for ResourcePermission. Methods of this
028     * service are expected to have security checks based on the propagated JAAS
029     * credentials because this service can be accessed remotely.
030     *
031     * @author Brian Wing Shun Chan
032     * @see ResourcePermissionServiceUtil
033     * @see com.liferay.portal.service.base.ResourcePermissionServiceBaseImpl
034     * @see com.liferay.portal.service.impl.ResourcePermissionServiceImpl
035     * @generated
036     */
037    @AccessControlled
038    @JSONWebService
039    @ProviderType
040    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
041            PortalException.class, SystemException.class})
042    public interface ResourcePermissionService extends BaseService {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * Never modify or reference this interface directly. Always use {@link ResourcePermissionServiceUtil} to access the resource permission remote service. Add custom service methods to {@link com.liferay.portal.service.impl.ResourcePermissionServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
047             */
048    
049            /**
050            * Grants the role permission at the scope to perform the action on
051            * resources of the type. Existing actions are retained.
052            *
053            * <p>
054            * This method cannot be used to grant individual scope permissions, but is
055            * only intended for adding permissions at the company, group, and
056            * group-template scopes. For example, this method could be used to grant a
057            * company scope permission to edit message board posts.
058            * </p>
059            *
060            * <p>
061            * If a company scope permission is granted to resources that the role
062            * already had group scope permissions to, the group scope permissions are
063            * deleted. Likewise, if a group scope permission is granted to resources
064            * that the role already had company scope permissions to, the company scope
065            * permissions are deleted. Be aware that this latter behavior can result in
066            * an overall reduction in permissions for the role.
067            * </p>
068            *
069            * <p>
070            * Depending on the scope, the value of <code>primKey</code> will have
071            * different meanings. For more information, see {@link
072            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
073            * </p>
074            *
075            * @param groupId the primary key of the group
076            * @param companyId the primary key of the company
077            * @param name the resource's name, which can be either a class name or a
078            portlet ID
079            * @param scope the scope. This method only supports company, group, and
080            group-template scope.
081            * @param primKey the primary key
082            * @param roleId the primary key of the role
083            * @param actionId the action ID
084            */
085            public void addResourcePermission(long groupId, long companyId,
086                    java.lang.String name, int scope, java.lang.String primKey,
087                    long roleId, java.lang.String actionId) throws PortalException;
088    
089            /**
090            * Returns the OSGi service identifier.
091            *
092            * @return the OSGi service identifier
093            */
094            public java.lang.String getOSGiServiceIdentifier();
095    
096            /**
097            * Revokes permission at the scope from the role to perform the action on
098            * resources of the type. For example, this method could be used to revoke a
099            * group scope permission to edit blog posts.
100            *
101            * <p>
102            * Depending on the scope, the value of <code>primKey</code> will have
103            * different meanings. For more information, see {@link
104            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
105            * </p>
106            *
107            * @param groupId the primary key of the group
108            * @param companyId the primary key of the company
109            * @param name the resource's name, which can be either a class name or a
110            portlet ID
111            * @param scope the scope
112            * @param primKey the primary key
113            * @param roleId the primary key of the role
114            * @param actionId the action ID
115            */
116            public void removeResourcePermission(long groupId, long companyId,
117                    java.lang.String name, int scope, java.lang.String primKey,
118                    long roleId, java.lang.String actionId) throws PortalException;
119    
120            /**
121            * Revokes all permissions at the scope from the role to perform the action
122            * on resources of the type. For example, this method could be used to
123            * revoke all individual scope permissions to edit blog posts from site
124            * members.
125            *
126            * @param groupId the primary key of the group
127            * @param companyId the primary key of the company
128            * @param name the resource's name, which can be either a class name or a
129            portlet ID
130            * @param scope the scope
131            * @param roleId the primary key of the role
132            * @param actionId the action ID
133            */
134            public void removeResourcePermissions(long groupId, long companyId,
135                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
136                    throws PortalException;
137    
138            /**
139            * Updates the role's permissions at the scope, setting the actions that can
140            * be performed on resources of the type. Existing actions are replaced.
141            *
142            * <p>
143            * This method can be used to set permissions at any scope, but it is
144            * generally only used at the individual scope. For example, it could be
145            * used to set the guest permissions on a blog post.
146            * </p>
147            *
148            * <p>
149            * Depending on the scope, the value of <code>primKey</code> will have
150            * different meanings. For more information, see {@link
151            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
152            * </p>
153            *
154            * @param groupId the primary key of the group
155            * @param companyId the primary key of the company
156            * @param name the resource's name, which can be either a class name or a
157            portlet ID
158            * @param primKey the primary key
159            * @param roleId the primary key of the role
160            * @param actionIds the action IDs of the actions
161            */
162            public void setIndividualResourcePermissions(long groupId, long companyId,
163                    java.lang.String name, java.lang.String primKey, long roleId,
164                    java.lang.String[] actionIds) throws PortalException;
165    
166            /**
167            * Updates the role's permissions at the scope, setting the actions that can
168            * be performed on resources of the type. Existing actions are replaced.
169            *
170            * <p>
171            * This method can be used to set permissions at any scope, but it is
172            * generally only used at the individual scope. For example, it could be
173            * used to set the guest permissions on a blog post.
174            * </p>
175            *
176            * <p>
177            * Depending on the scope, the value of <code>primKey</code> will have
178            * different meanings. For more information, see {@link
179            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
180            * </p>
181            *
182            * @param groupId the primary key of the group
183            * @param companyId the primary key of the company
184            * @param name the resource's name, which can be either a class name or a
185            portlet ID
186            * @param primKey the primary key
187            * @param roleIdsToActionIds a map of role IDs to action IDs of the actions
188            */
189            public void setIndividualResourcePermissions(long groupId, long companyId,
190                    java.lang.String name, java.lang.String primKey,
191                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
192                    throws PortalException;
193    }