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.kernel.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    import java.util.Map;
027    
028    /**
029     * Provides the remote service interface for ResourcePermission. Methods of this
030     * service are expected to have security checks based on the propagated JAAS
031     * credentials because this service can be accessed remotely.
032     *
033     * @author Brian Wing Shun Chan
034     * @see ResourcePermissionServiceUtil
035     * @see com.liferay.portal.service.base.ResourcePermissionServiceBaseImpl
036     * @see com.liferay.portal.service.impl.ResourcePermissionServiceImpl
037     * @generated
038     */
039    @AccessControlled
040    @JSONWebService
041    @ProviderType
042    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
043            PortalException.class, SystemException.class})
044    public interface ResourcePermissionService extends BaseService {
045            /*
046             * NOTE FOR DEVELOPERS:
047             *
048             * 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.
049             */
050    
051            /**
052            * Returns the OSGi service identifier.
053            *
054            * @return the OSGi service identifier
055            */
056            public java.lang.String getOSGiServiceIdentifier();
057    
058            /**
059            * Grants the role permission at the scope to perform the action on
060            * resources of the type. Existing actions are retained.
061            *
062            * <p>
063            * This method cannot be used to grant individual scope permissions, but is
064            * only intended for adding permissions at the company, group, and
065            * group-template scopes. For example, this method could be used to grant a
066            * company scope permission to edit message board posts.
067            * </p>
068            *
069            * <p>
070            * If a company scope permission is granted to resources that the role
071            * already had group scope permissions to, the group scope permissions are
072            * deleted. Likewise, if a group scope permission is granted to resources
073            * that the role already had company scope permissions to, the company scope
074            * permissions are deleted. Be aware that this latter behavior can result in
075            * an overall reduction in permissions for the role.
076            * </p>
077            *
078            * <p>
079            * Depending on the scope, the value of <code>primKey</code> will have
080            * different meanings. For more information, see {@link
081            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
082            * </p>
083            *
084            * @param groupId the primary key of the group
085            * @param companyId the primary key of the company
086            * @param name the resource's name, which can be either a class name or a
087            portlet ID
088            * @param scope the scope. This method only supports company, group, and
089            group-template scope.
090            * @param primKey the primary key
091            * @param roleId the primary key of the role
092            * @param actionId the action ID
093            */
094            public void addResourcePermission(long groupId, long companyId,
095                    java.lang.String name, int scope, java.lang.String primKey,
096                    long roleId, java.lang.String actionId) throws PortalException;
097    
098            /**
099            * Revokes permission at the scope from the role to perform the action on
100            * resources of the type. For example, this method could be used to revoke a
101            * group scope permission to edit blog posts.
102            *
103            * <p>
104            * Depending on the scope, the value of <code>primKey</code> will have
105            * different meanings. For more information, see {@link
106            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
107            * </p>
108            *
109            * @param groupId the primary key of the group
110            * @param companyId the primary key of the company
111            * @param name the resource's name, which can be either a class name or a
112            portlet ID
113            * @param scope the scope
114            * @param primKey the primary key
115            * @param roleId the primary key of the role
116            * @param actionId the action ID
117            */
118            public void removeResourcePermission(long groupId, long companyId,
119                    java.lang.String name, int scope, java.lang.String primKey,
120                    long roleId, java.lang.String actionId) throws PortalException;
121    
122            /**
123            * Revokes all permissions at the scope from the role to perform the action
124            * on resources of the type. For example, this method could be used to
125            * revoke all individual scope permissions to edit blog posts from site
126            * members.
127            *
128            * @param groupId the primary key of the group
129            * @param companyId the primary key of the company
130            * @param name the resource's name, which can be either a class name or a
131            portlet ID
132            * @param scope the scope
133            * @param roleId the primary key of the role
134            * @param actionId the action ID
135            */
136            public void removeResourcePermissions(long groupId, long companyId,
137                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
138                    throws PortalException;
139    
140            /**
141            * Updates the role's permissions at the scope, setting the actions that can
142            * be performed on resources of the type. Existing actions are replaced.
143            *
144            * <p>
145            * This method can be used to set permissions at any scope, but it is
146            * generally only used at the individual scope. For example, it could be
147            * used to set the guest permissions on a blog post.
148            * </p>
149            *
150            * <p>
151            * Depending on the scope, the value of <code>primKey</code> will have
152            * different meanings. For more information, see {@link
153            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
154            * </p>
155            *
156            * @param groupId the primary key of the group
157            * @param companyId the primary key of the company
158            * @param name the resource's name, which can be either a class name or a
159            portlet ID
160            * @param primKey the primary key
161            * @param roleIdsToActionIds a map of role IDs to action IDs of the actions
162            */
163            public void setIndividualResourcePermissions(long groupId, long companyId,
164                    java.lang.String name, java.lang.String primKey,
165                    Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
166                    throws PortalException;
167    
168            /**
169            * Updates the role's permissions at the scope, setting the actions that can
170            * be performed on resources of the type. Existing actions are replaced.
171            *
172            * <p>
173            * This method can be used to set permissions at any scope, but it is
174            * generally only used at the individual scope. For example, it could be
175            * used to set the guest permissions on a blog post.
176            * </p>
177            *
178            * <p>
179            * Depending on the scope, the value of <code>primKey</code> will have
180            * different meanings. For more information, see {@link
181            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
182            * </p>
183            *
184            * @param groupId the primary key of the group
185            * @param companyId the primary key of the company
186            * @param name the resource's name, which can be either a class name or a
187            portlet ID
188            * @param primKey the primary key
189            * @param roleId the primary key of the role
190            * @param actionIds the action IDs of the actions
191            */
192            public void setIndividualResourcePermissions(long groupId, long companyId,
193                    java.lang.String name, java.lang.String primKey, long roleId,
194                    java.lang.String[] actionIds) throws PortalException;
195    }