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    /**
018     * Provides a wrapper for {@link ResourcePermissionService}.
019     *
020     * @author Brian Wing Shun Chan
021     * @see ResourcePermissionService
022     * @generated
023     */
024    public class ResourcePermissionServiceWrapper
025            implements ResourcePermissionService,
026                    ServiceWrapper<ResourcePermissionService> {
027            public ResourcePermissionServiceWrapper(
028                    ResourcePermissionService resourcePermissionService) {
029                    _resourcePermissionService = resourcePermissionService;
030            }
031    
032            /**
033            * Returns the Spring bean ID for this bean.
034            *
035            * @return the Spring bean ID for this bean
036            */
037            @Override
038            public java.lang.String getBeanIdentifier() {
039                    return _resourcePermissionService.getBeanIdentifier();
040            }
041    
042            /**
043            * Sets the Spring bean ID for this bean.
044            *
045            * @param beanIdentifier the Spring bean ID for this bean
046            */
047            @Override
048            public void setBeanIdentifier(java.lang.String beanIdentifier) {
049                    _resourcePermissionService.setBeanIdentifier(beanIdentifier);
050            }
051    
052            /**
053            * Grants the role permission at the scope to perform the action on
054            * resources of the type. Existing actions are retained.
055            *
056            * <p>
057            * This method cannot be used to grant individual scope permissions, but is
058            * only intended for adding permissions at the company, group, and
059            * group-template scopes. For example, this method could be used to grant a
060            * company scope permission to edit message board posts.
061            * </p>
062            *
063            * <p>
064            * If a company scope permission is granted to resources that the role
065            * already had group scope permissions to, the group scope permissions are
066            * deleted. Likewise, if a group scope permission is granted to resources
067            * that the role already had company scope permissions to, the company scope
068            * permissions are deleted. Be aware that this latter behavior can result in
069            * an overall reduction in permissions for the role.
070            * </p>
071            *
072            * <p>
073            * Depending on the scope, the value of <code>primKey</code> will have
074            * different meanings. For more information, see {@link
075            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
076            * </p>
077            *
078            * @param groupId the primary key of the group
079            * @param companyId the primary key of the company
080            * @param name the resource's name, which can be either a class name or a
081            portlet ID
082            * @param scope the scope. This method only supports company, group, and
083            group-template scope.
084            * @param primKey the primary key
085            * @param roleId the primary key of the role
086            * @param actionId the action ID
087            * @throws PortalException if the user did not have permission to add
088            resource permissions, or if scope was set to individual scope or
089            if a role with the primary key or a resource action with the name
090            and action ID could not be found
091            * @throws SystemException if a system exception occurred
092            */
093            @Override
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)
097                    throws com.liferay.portal.kernel.exception.PortalException,
098                            com.liferay.portal.kernel.exception.SystemException {
099                    _resourcePermissionService.addResourcePermission(groupId, companyId,
100                            name, scope, primKey, roleId, actionId);
101            }
102    
103            /**
104            * Revokes permission at the scope from the role to perform the action on
105            * resources of the type. For example, this method could be used to revoke a
106            * group scope permission to edit blog posts.
107            *
108            * <p>
109            * Depending on the scope, the value of <code>primKey</code> will have
110            * different meanings. For more information, see {@link
111            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
112            * </p>
113            *
114            * @param groupId the primary key of the group
115            * @param companyId the primary key of the company
116            * @param name the resource's name, which can be either a class name or a
117            portlet ID
118            * @param scope the scope
119            * @param primKey the primary key
120            * @param roleId the primary key of the role
121            * @param actionId the action ID
122            * @throws PortalException if the user did not have permission to remove
123            resource permissions, or if a role with the primary key or a
124            resource action with the name and action ID could not be found
125            * @throws SystemException if a system exception occurred
126            */
127            @Override
128            public void removeResourcePermission(long groupId, long companyId,
129                    java.lang.String name, int scope, java.lang.String primKey,
130                    long roleId, java.lang.String actionId)
131                    throws com.liferay.portal.kernel.exception.PortalException,
132                            com.liferay.portal.kernel.exception.SystemException {
133                    _resourcePermissionService.removeResourcePermission(groupId, companyId,
134                            name, scope, primKey, roleId, actionId);
135            }
136    
137            /**
138            * Revokes all permissions at the scope from the role to perform the action
139            * on resources of the type. For example, this method could be used to
140            * revoke all individual scope permissions to edit blog posts from site
141            * members.
142            *
143            * @param groupId the primary key of the group
144            * @param companyId the primary key of the company
145            * @param name the resource's name, which can be either a class name or a
146            portlet ID
147            * @param scope the scope
148            * @param roleId the primary key of the role
149            * @param actionId the action ID
150            * @throws PortalException if the user did not have permission to remove
151            resource permissions, or if a role with the primary key or a
152            resource action with the name and action ID could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            @Override
156            public void removeResourcePermissions(long groupId, long companyId,
157                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
158                    throws com.liferay.portal.kernel.exception.PortalException,
159                            com.liferay.portal.kernel.exception.SystemException {
160                    _resourcePermissionService.removeResourcePermissions(groupId,
161                            companyId, name, scope, roleId, actionId);
162            }
163    
164            /**
165            * Updates the role's permissions at the scope, setting the actions that can
166            * be performed on resources of the type. Existing actions are replaced.
167            *
168            * <p>
169            * This method can be used to set permissions at any scope, but it is
170            * generally only used at the individual scope. For example, it could be
171            * used to set the guest permissions on a blog post.
172            * </p>
173            *
174            * <p>
175            * Depending on the scope, the value of <code>primKey</code> will have
176            * different meanings. For more information, see {@link
177            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
178            * </p>
179            *
180            * @param groupId the primary key of the group
181            * @param companyId the primary key of the company
182            * @param name the resource's name, which can be either a class name or a
183            portlet ID
184            * @param primKey the primary key
185            * @param roleId the primary key of the role
186            * @param actionIds the action IDs of the actions
187            * @throws PortalException if the user did not have permission to set
188            resource permissions, or if a role with the primary key or a
189            resource action with the name and action ID could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            @Override
193            public void setIndividualResourcePermissions(long groupId, long companyId,
194                    java.lang.String name, java.lang.String primKey, long roleId,
195                    java.lang.String[] actionIds)
196                    throws com.liferay.portal.kernel.exception.PortalException,
197                            com.liferay.portal.kernel.exception.SystemException {
198                    _resourcePermissionService.setIndividualResourcePermissions(groupId,
199                            companyId, name, primKey, roleId, actionIds);
200            }
201    
202            /**
203            * Updates the role's permissions at the scope, setting the actions that can
204            * be performed on resources of the type. Existing actions are replaced.
205            *
206            * <p>
207            * This method can be used to set permissions at any scope, but it is
208            * generally only used at the individual scope. For example, it could be
209            * used to set the guest permissions on a blog post.
210            * </p>
211            *
212            * <p>
213            * Depending on the scope, the value of <code>primKey</code> will have
214            * different meanings. For more information, see {@link
215            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
216            * </p>
217            *
218            * @param groupId the primary key of the group
219            * @param companyId the primary key of the company
220            * @param name the resource's name, which can be either a class name or a
221            portlet ID
222            * @param primKey the primary key
223            * @param roleIdsToActionIds a map of role IDs to action IDs of the actions
224            * @throws PortalException if the user did not have permission to set
225            resource permissions, or if a role with the primary key or a
226            resource action with the name and action ID could not be found
227            * @throws SystemException if a system exception occurred
228            */
229            @Override
230            public void setIndividualResourcePermissions(long groupId, long companyId,
231                    java.lang.String name, java.lang.String primKey,
232                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
233                    throws com.liferay.portal.kernel.exception.PortalException,
234                            com.liferay.portal.kernel.exception.SystemException {
235                    _resourcePermissionService.setIndividualResourcePermissions(groupId,
236                            companyId, name, primKey, roleIdsToActionIds);
237            }
238    
239            /**
240             * @deprecated As of 6.1.0, replaced by {@link #getWrappedService}
241             */
242            public ResourcePermissionService getWrappedResourcePermissionService() {
243                    return _resourcePermissionService;
244            }
245    
246            /**
247             * @deprecated As of 6.1.0, replaced by {@link #setWrappedService}
248             */
249            public void setWrappedResourcePermissionService(
250                    ResourcePermissionService resourcePermissionService) {
251                    _resourcePermissionService = resourcePermissionService;
252            }
253    
254            @Override
255            public ResourcePermissionService getWrappedService() {
256                    return _resourcePermissionService;
257            }
258    
259            @Override
260            public void setWrappedService(
261                    ResourcePermissionService resourcePermissionService) {
262                    _resourcePermissionService = resourcePermissionService;
263            }
264    
265            private ResourcePermissionService _resourcePermissionService;
266    }