001    /**
002     * Copyright (c) 2000-2013 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.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Transactional;
024    import com.liferay.portal.security.ac.AccessControlled;
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    @ProviderType
038    @AccessControlled
039    @JSONWebService
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            * Returns the Spring bean ID for this bean.
051            *
052            * @return the Spring bean ID for this bean
053            */
054            public java.lang.String getBeanIdentifier();
055    
056            /**
057            * Sets the Spring bean ID for this bean.
058            *
059            * @param beanIdentifier the Spring bean ID for this bean
060            */
061            public void setBeanIdentifier(java.lang.String beanIdentifier);
062    
063            /**
064            * Grants the role permission at the scope to perform the action on
065            * resources of the type. Existing actions are retained.
066            *
067            * <p>
068            * This method cannot be used to grant individual scope permissions, but is
069            * only intended for adding permissions at the company, group, and
070            * group-template scopes. For example, this method could be used to grant a
071            * company scope permission to edit message board posts.
072            * </p>
073            *
074            * <p>
075            * If a company scope permission is granted to resources that the role
076            * already had group scope permissions to, the group scope permissions are
077            * deleted. Likewise, if a group scope permission is granted to resources
078            * that the role already had company scope permissions to, the company scope
079            * permissions are deleted. Be aware that this latter behavior can result in
080            * an overall reduction in permissions for the role.
081            * </p>
082            *
083            * <p>
084            * Depending on the scope, the value of <code>primKey</code> will have
085            * different meanings. For more information, see {@link
086            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
087            * </p>
088            *
089            * @param groupId the primary key of the group
090            * @param companyId the primary key of the company
091            * @param name the resource's name, which can be either a class name or a
092            portlet ID
093            * @param scope the scope. This method only supports company, group, and
094            group-template scope.
095            * @param primKey the primary key
096            * @param roleId the primary key of the role
097            * @param actionId the action ID
098            * @throws PortalException if the user did not have permission to add
099            resource permissions, or if scope was set to individual scope or
100            if a role with the primary key or a resource action with the name
101            and action ID could not be found
102            * @throws SystemException if a system exception occurred
103            */
104            public void addResourcePermission(long groupId, long companyId,
105                    java.lang.String name, int scope, java.lang.String primKey,
106                    long roleId, java.lang.String actionId)
107                    throws com.liferay.portal.kernel.exception.PortalException,
108                            com.liferay.portal.kernel.exception.SystemException;
109    
110            /**
111            * Revokes permission at the scope from the role to perform the action on
112            * resources of the type. For example, this method could be used to revoke a
113            * group scope permission to edit blog posts.
114            *
115            * <p>
116            * Depending on the scope, the value of <code>primKey</code> will have
117            * different meanings. For more information, see {@link
118            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
119            * </p>
120            *
121            * @param groupId the primary key of the group
122            * @param companyId the primary key of the company
123            * @param name the resource's name, which can be either a class name or a
124            portlet ID
125            * @param scope the scope
126            * @param primKey the primary key
127            * @param roleId the primary key of the role
128            * @param actionId the action ID
129            * @throws PortalException if the user did not have permission to remove
130            resource permissions, or if a role with the primary key or a
131            resource action with the name and action ID could not be found
132            * @throws SystemException if a system exception occurred
133            */
134            public void removeResourcePermission(long groupId, long companyId,
135                    java.lang.String name, int scope, java.lang.String primKey,
136                    long roleId, java.lang.String actionId)
137                    throws com.liferay.portal.kernel.exception.PortalException,
138                            com.liferay.portal.kernel.exception.SystemException;
139    
140            /**
141            * Revokes all permissions at the scope from the role to perform the action
142            * on resources of the type. For example, this method could be used to
143            * revoke all individual scope permissions to edit blog posts from site
144            * members.
145            *
146            * @param groupId the primary key of the group
147            * @param companyId the primary key of the company
148            * @param name the resource's name, which can be either a class name or a
149            portlet ID
150            * @param scope the scope
151            * @param roleId the primary key of the role
152            * @param actionId the action ID
153            * @throws PortalException if the user did not have permission to remove
154            resource permissions, or if a role with the primary key or a
155            resource action with the name and action ID could not be found
156            * @throws SystemException if a system exception occurred
157            */
158            public void removeResourcePermissions(long groupId, long companyId,
159                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
160                    throws com.liferay.portal.kernel.exception.PortalException,
161                            com.liferay.portal.kernel.exception.SystemException;
162    
163            /**
164            * Updates the role's permissions at the scope, setting the actions that can
165            * be performed on resources of the type. Existing actions are replaced.
166            *
167            * <p>
168            * This method can be used to set permissions at any scope, but it is
169            * generally only used at the individual scope. For example, it could be
170            * used to set the guest permissions on a blog post.
171            * </p>
172            *
173            * <p>
174            * Depending on the scope, the value of <code>primKey</code> will have
175            * different meanings. For more information, see {@link
176            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
177            * </p>
178            *
179            * @param groupId the primary key of the group
180            * @param companyId the primary key of the company
181            * @param name the resource's name, which can be either a class name or a
182            portlet ID
183            * @param primKey the primary key
184            * @param roleId the primary key of the role
185            * @param actionIds the action IDs of the actions
186            * @throws PortalException if the user did not have permission to set
187            resource permissions, or if a role with the primary key or a
188            resource action with the name and action ID could not be found
189            * @throws SystemException if a system exception occurred
190            */
191            public void setIndividualResourcePermissions(long groupId, long companyId,
192                    java.lang.String name, java.lang.String primKey, long roleId,
193                    java.lang.String[] actionIds)
194                    throws com.liferay.portal.kernel.exception.PortalException,
195                            com.liferay.portal.kernel.exception.SystemException;
196    
197            /**
198            * Updates the role's permissions at the scope, setting the actions that can
199            * be performed on resources of the type. Existing actions are replaced.
200            *
201            * <p>
202            * This method can be used to set permissions at any scope, but it is
203            * generally only used at the individual scope. For example, it could be
204            * used to set the guest permissions on a blog post.
205            * </p>
206            *
207            * <p>
208            * Depending on the scope, the value of <code>primKey</code> will have
209            * different meanings. For more information, see {@link
210            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
211            * </p>
212            *
213            * @param groupId the primary key of the group
214            * @param companyId the primary key of the company
215            * @param name the resource's name, which can be either a class name or a
216            portlet ID
217            * @param primKey the primary key
218            * @param roleIdsToActionIds a map of role IDs to action IDs of the actions
219            * @throws PortalException if the user did not have permission to set
220            resource permissions, or if a role with the primary key or a
221            resource action with the name and action ID could not be found
222            * @throws SystemException if a system exception occurred
223            */
224            public void setIndividualResourcePermissions(long groupId, long companyId,
225                    java.lang.String name, java.lang.String primKey,
226                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
227                    throws com.liferay.portal.kernel.exception.PortalException,
228                            com.liferay.portal.kernel.exception.SystemException;
229    }