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 com.liferay.portal.kernel.exception.PortalException; 018 import com.liferay.portal.kernel.exception.SystemException; 019 import com.liferay.portal.kernel.jsonwebservice.JSONWebService; 020 import com.liferay.portal.kernel.transaction.Isolation; 021 import com.liferay.portal.kernel.transaction.Transactional; 022 023 /** 024 * The interface for the resource permission remote service. 025 * 026 * <p> 027 * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely. 028 * </p> 029 * 030 * @author Brian Wing Shun Chan 031 * @see ResourcePermissionServiceUtil 032 * @see com.liferay.portal.service.base.ResourcePermissionServiceBaseImpl 033 * @see com.liferay.portal.service.impl.ResourcePermissionServiceImpl 034 * @generated 035 */ 036 @JSONWebService 037 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 038 PortalException.class, SystemException.class}) 039 public interface ResourcePermissionService extends BaseService { 040 /* 041 * NOTE FOR DEVELOPERS: 042 * 043 * 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. 044 */ 045 046 /** 047 * Returns the Spring bean ID for this bean. 048 * 049 * @return the Spring bean ID for this bean 050 */ 051 public java.lang.String getBeanIdentifier(); 052 053 /** 054 * Sets the Spring bean ID for this bean. 055 * 056 * @param beanIdentifier the Spring bean ID for this bean 057 */ 058 public void setBeanIdentifier(java.lang.String beanIdentifier); 059 060 /** 061 * Grants the role permission at the scope to perform the action on 062 * resources of the type. Existing actions are retained. 063 * 064 * <p> 065 * This method cannot be used to grant individual scope permissions, but is 066 * only intended for adding permissions at the company, group, and 067 * group-template scopes. For example, this method could be used to grant a 068 * company scope permission to edit message board posts. 069 * </p> 070 * 071 * <p> 072 * If a company scope permission is granted to resources that the role 073 * already had group scope permissions to, the group scope permissions are 074 * deleted. Likewise, if a group scope permission is granted to resources 075 * that the role already had company scope permissions to, the company scope 076 * permissions are deleted. Be aware that this latter behavior can result in 077 * an overall reduction in permissions for the role. 078 * </p> 079 * 080 * <p> 081 * Depending on the scope, the value of <code>primKey</code> will have 082 * different meanings. For more information, see {@link 083 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 084 * </p> 085 * 086 * @param groupId the primary key of the group 087 * @param companyId the primary key of the company 088 * @param name the resource's name, which can be either a class name or a 089 portlet ID 090 * @param scope the scope. This method only supports company, group, and 091 group-template scope. 092 * @param primKey the primary key 093 * @param roleId the primary key of the role 094 * @param actionId the action ID 095 * @throws PortalException if the user did not have permission to add 096 resource permissions, or if scope was set to individual scope or 097 if a role with the primary key or a resource action with the name 098 and action ID could not be found 099 * @throws SystemException if a system exception occurred 100 */ 101 public void addResourcePermission(long groupId, long companyId, 102 java.lang.String name, int scope, java.lang.String primKey, 103 long roleId, java.lang.String actionId) 104 throws com.liferay.portal.kernel.exception.PortalException, 105 com.liferay.portal.kernel.exception.SystemException; 106 107 /** 108 * Revokes permission at the scope from the role to perform the action on 109 * resources of the type. For example, this method could be used to revoke a 110 * group scope permission to edit blog posts. 111 * 112 * <p> 113 * Depending on the scope, the value of <code>primKey</code> will have 114 * different meanings. For more information, see {@link 115 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 116 * </p> 117 * 118 * @param groupId the primary key of the group 119 * @param companyId the primary key of the company 120 * @param name the resource's name, which can be either a class name or a 121 portlet ID 122 * @param scope the scope 123 * @param primKey the primary key 124 * @param roleId the primary key of the role 125 * @param actionId the action ID 126 * @throws PortalException if the user did not have permission to remove 127 resource permissions, or if a role with the primary key or a 128 resource action with the name and action ID could not be found 129 * @throws SystemException if a system exception occurred 130 */ 131 public void removeResourcePermission(long groupId, long companyId, 132 java.lang.String name, int scope, java.lang.String primKey, 133 long roleId, java.lang.String actionId) 134 throws com.liferay.portal.kernel.exception.PortalException, 135 com.liferay.portal.kernel.exception.SystemException; 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 public void removeResourcePermissions(long groupId, long companyId, 156 java.lang.String name, int scope, long roleId, java.lang.String actionId) 157 throws com.liferay.portal.kernel.exception.PortalException, 158 com.liferay.portal.kernel.exception.SystemException; 159 160 /** 161 * Updates the role's permissions at the scope, setting the actions that can 162 * be performed on resources of the type. Existing actions are replaced. 163 * 164 * <p> 165 * This method can be used to set permissions at any scope, but it is 166 * generally only used at the individual scope. For example, it could be 167 * used to set the guest permissions on a blog post. 168 * </p> 169 * 170 * <p> 171 * Depending on the scope, the value of <code>primKey</code> will have 172 * different meanings. For more information, see {@link 173 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 174 * </p> 175 * 176 * @param groupId the primary key of the group 177 * @param companyId the primary key of the company 178 * @param name the resource's name, which can be either a class name or a 179 portlet ID 180 * @param primKey the primary key 181 * @param roleId the primary key of the role 182 * @param actionIds the action IDs of the actions 183 * @throws PortalException if the user did not have permission to set 184 resource permissions, or if a role with the primary key or a 185 resource action with the name and action ID could not be found 186 * @throws SystemException if a system exception occurred 187 */ 188 public void setIndividualResourcePermissions(long groupId, long companyId, 189 java.lang.String name, java.lang.String primKey, long roleId, 190 java.lang.String[] actionIds) 191 throws com.liferay.portal.kernel.exception.PortalException, 192 com.liferay.portal.kernel.exception.SystemException; 193 194 /** 195 * Updates the role's permissions at the scope, setting the actions that can 196 * be performed on resources of the type. Existing actions are replaced. 197 * 198 * <p> 199 * This method can be used to set permissions at any scope, but it is 200 * generally only used at the individual scope. For example, it could be 201 * used to set the guest permissions on a blog post. 202 * </p> 203 * 204 * <p> 205 * Depending on the scope, the value of <code>primKey</code> will have 206 * different meanings. For more information, see {@link 207 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 208 * </p> 209 * 210 * @param groupId the primary key of the group 211 * @param companyId the primary key of the company 212 * @param name the resource's name, which can be either a class name or a 213 portlet ID 214 * @param primKey the primary key 215 * @param roleIdsToActionIds a map of role IDs to action IDs of the actions 216 * @throws PortalException if the user did not have permission to set 217 resource permissions, or if a role with the primary key or a 218 resource action with the name and action ID could not be found 219 * @throws SystemException if a system exception occurred 220 */ 221 public void setIndividualResourcePermissions(long groupId, long companyId, 222 java.lang.String name, java.lang.String primKey, 223 java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds) 224 throws com.liferay.portal.kernel.exception.PortalException, 225 com.liferay.portal.kernel.exception.SystemException; 226 }