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 * @throws PortalException if the user did not have permission to add 085 resource permissions, or if scope was set to individual scope or 086 if a role with the primary key or a resource action with the name 087 and action ID could not be found 088 */ 089 public void addResourcePermission(long groupId, long companyId, 090 java.lang.String name, int scope, java.lang.String primKey, 091 long roleId, java.lang.String actionId) throws PortalException; 092 093 /** 094 * Returns the Spring bean ID for this bean. 095 * 096 * @return the Spring bean ID for this bean 097 */ 098 public java.lang.String getBeanIdentifier(); 099 100 /** 101 * Revokes permission at the scope from the role to perform the action on 102 * resources of the type. For example, this method could be used to revoke a 103 * group scope permission to edit blog posts. 104 * 105 * <p> 106 * Depending on the scope, the value of <code>primKey</code> will have 107 * different meanings. For more information, see {@link 108 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 109 * </p> 110 * 111 * @param groupId the primary key of the group 112 * @param companyId the primary key of the company 113 * @param name the resource's name, which can be either a class name or a 114 portlet ID 115 * @param scope the scope 116 * @param primKey the primary key 117 * @param roleId the primary key of the role 118 * @param actionId the action ID 119 * @throws PortalException if the user did not have permission to remove 120 resource permissions, or if a role with the primary key or a 121 resource action with the name and action ID could not be found 122 */ 123 public void removeResourcePermission(long groupId, long companyId, 124 java.lang.String name, int scope, java.lang.String primKey, 125 long roleId, java.lang.String actionId) throws PortalException; 126 127 /** 128 * Revokes all permissions at the scope from the role to perform the action 129 * on resources of the type. For example, this method could be used to 130 * revoke all individual scope permissions to edit blog posts from site 131 * members. 132 * 133 * @param groupId the primary key of the group 134 * @param companyId the primary key of the company 135 * @param name the resource's name, which can be either a class name or a 136 portlet ID 137 * @param scope the scope 138 * @param roleId the primary key of the role 139 * @param actionId the action ID 140 * @throws PortalException if the user did not have permission to remove 141 resource permissions, or if a role with the primary key or a 142 resource action with the name and action ID could not be found 143 */ 144 public void removeResourcePermissions(long groupId, long companyId, 145 java.lang.String name, int scope, long roleId, java.lang.String actionId) 146 throws PortalException; 147 148 /** 149 * Sets the Spring bean ID for this bean. 150 * 151 * @param beanIdentifier the Spring bean ID for this bean 152 */ 153 public void setBeanIdentifier(java.lang.String beanIdentifier); 154 155 /** 156 * Updates the role's permissions at the scope, setting the actions that can 157 * be performed on resources of the type. Existing actions are replaced. 158 * 159 * <p> 160 * This method can be used to set permissions at any scope, but it is 161 * generally only used at the individual scope. For example, it could be 162 * used to set the guest permissions on a blog post. 163 * </p> 164 * 165 * <p> 166 * Depending on the scope, the value of <code>primKey</code> will have 167 * different meanings. For more information, see {@link 168 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 169 * </p> 170 * 171 * @param groupId the primary key of the group 172 * @param companyId the primary key of the company 173 * @param name the resource's name, which can be either a class name or a 174 portlet ID 175 * @param primKey the primary key 176 * @param roleId the primary key of the role 177 * @param actionIds the action IDs of the actions 178 * @throws PortalException if the user did not have permission to set 179 resource permissions, or if a role with the primary key or a 180 resource action with the name and action ID could not be found 181 */ 182 public void setIndividualResourcePermissions(long groupId, long companyId, 183 java.lang.String name, java.lang.String primKey, long roleId, 184 java.lang.String[] actionIds) throws PortalException; 185 186 /** 187 * Updates the role's permissions at the scope, setting the actions that can 188 * be performed on resources of the type. Existing actions are replaced. 189 * 190 * <p> 191 * This method can be used to set permissions at any scope, but it is 192 * generally only used at the individual scope. For example, it could be 193 * used to set the guest permissions on a blog post. 194 * </p> 195 * 196 * <p> 197 * Depending on the scope, the value of <code>primKey</code> will have 198 * different meanings. For more information, see {@link 199 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 200 * </p> 201 * 202 * @param groupId the primary key of the group 203 * @param companyId the primary key of the company 204 * @param name the resource's name, which can be either a class name or a 205 portlet ID 206 * @param primKey the primary key 207 * @param roleIdsToActionIds a map of role IDs to action IDs of the actions 208 * @throws PortalException if the user did not have permission to set 209 resource permissions, or if a role with the primary key or a 210 resource action with the name and action ID could not be found 211 */ 212 public void setIndividualResourcePermissions(long groupId, long companyId, 213 java.lang.String name, java.lang.String primKey, 214 java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds) 215 throws PortalException; 216 }