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.dao.orm.ActionableDynamicQuery; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.Projection; 023 import com.liferay.portal.kernel.exception.PortalException; 024 import com.liferay.portal.kernel.exception.SystemException; 025 import com.liferay.portal.kernel.search.Indexable; 026 import com.liferay.portal.kernel.search.IndexableType; 027 import com.liferay.portal.kernel.transaction.Isolation; 028 import com.liferay.portal.kernel.transaction.Propagation; 029 import com.liferay.portal.kernel.transaction.Transactional; 030 import com.liferay.portal.kernel.util.OrderByComparator; 031 import com.liferay.portal.model.PersistedModel; 032 import com.liferay.portal.model.ResourceBlockPermissionsContainer; 033 import com.liferay.portal.model.ResourceTypePermission; 034 035 import java.io.Serializable; 036 037 import java.util.List; 038 039 /** 040 * Provides the local service interface for ResourceTypePermission. Methods of this 041 * service will not have security checks based on the propagated JAAS 042 * credentials because this service can only be accessed from within the same 043 * VM. 044 * 045 * @author Brian Wing Shun Chan 046 * @see ResourceTypePermissionLocalServiceUtil 047 * @see com.liferay.portal.service.base.ResourceTypePermissionLocalServiceBaseImpl 048 * @see com.liferay.portal.service.impl.ResourceTypePermissionLocalServiceImpl 049 * @generated 050 */ 051 @ProviderType 052 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 053 PortalException.class, SystemException.class}) 054 public interface ResourceTypePermissionLocalService extends BaseLocalService, 055 PersistedModelLocalService { 056 /* 057 * NOTE FOR DEVELOPERS: 058 * 059 * Never modify or reference this interface directly. Always use {@link ResourceTypePermissionLocalServiceUtil} to access the resource type permission local service. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceTypePermissionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 060 */ 061 062 /** 063 * Adds the resource type permission to the database. Also notifies the appropriate model listeners. 064 * 065 * @param resourceTypePermission the resource type permission 066 * @return the resource type permission that was added 067 */ 068 @Indexable(type = IndexableType.REINDEX) 069 public ResourceTypePermission addResourceTypePermission( 070 ResourceTypePermission resourceTypePermission); 071 072 /** 073 * Creates a new resource type permission with the primary key. Does not add the resource type permission to the database. 074 * 075 * @param resourceTypePermissionId the primary key for the new resource type permission 076 * @return the new resource type permission 077 */ 078 public ResourceTypePermission createResourceTypePermission( 079 long resourceTypePermissionId); 080 081 /** 082 * @throws PortalException 083 */ 084 @Override 085 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 086 throws PortalException; 087 088 /** 089 * Deletes the resource type permission from the database. Also notifies the appropriate model listeners. 090 * 091 * @param resourceTypePermission the resource type permission 092 * @return the resource type permission that was removed 093 */ 094 @Indexable(type = IndexableType.DELETE) 095 public ResourceTypePermission deleteResourceTypePermission( 096 ResourceTypePermission resourceTypePermission); 097 098 /** 099 * Deletes the resource type permission with the primary key from the database. Also notifies the appropriate model listeners. 100 * 101 * @param resourceTypePermissionId the primary key of the resource type permission 102 * @return the resource type permission that was removed 103 * @throws PortalException if a resource type permission with the primary key could not be found 104 */ 105 @Indexable(type = IndexableType.DELETE) 106 public ResourceTypePermission deleteResourceTypePermission( 107 long resourceTypePermissionId) throws PortalException; 108 109 public DynamicQuery dynamicQuery(); 110 111 /** 112 * Performs a dynamic query on the database and returns the matching rows. 113 * 114 * @param dynamicQuery the dynamic query 115 * @return the matching rows 116 */ 117 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 118 119 /** 120 * Performs a dynamic query on the database and returns a range of the matching rows. 121 * 122 * <p> 123 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 124 * </p> 125 * 126 * @param dynamicQuery the dynamic query 127 * @param start the lower bound of the range of model instances 128 * @param end the upper bound of the range of model instances (not inclusive) 129 * @return the range of matching rows 130 */ 131 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 132 int end); 133 134 /** 135 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 136 * 137 * <p> 138 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 139 * </p> 140 * 141 * @param dynamicQuery the dynamic query 142 * @param start the lower bound of the range of model instances 143 * @param end the upper bound of the range of model instances (not inclusive) 144 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 145 * @return the ordered range of matching rows 146 */ 147 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 148 int end, OrderByComparator<T> orderByComparator); 149 150 /** 151 * Returns the number of rows matching the dynamic query. 152 * 153 * @param dynamicQuery the dynamic query 154 * @return the number of rows matching the dynamic query 155 */ 156 public long dynamicQueryCount(DynamicQuery dynamicQuery); 157 158 /** 159 * Returns the number of rows matching the dynamic query. 160 * 161 * @param dynamicQuery the dynamic query 162 * @param projection the projection to apply to the query 163 * @return the number of rows matching the dynamic query 164 */ 165 public long dynamicQueryCount(DynamicQuery dynamicQuery, 166 Projection projection); 167 168 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 169 public ResourceTypePermission fetchResourceTypePermission( 170 long resourceTypePermissionId); 171 172 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 173 public ActionableDynamicQuery getActionableDynamicQuery(); 174 175 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 176 public long getCompanyScopeActionIds(long companyId, java.lang.String name, 177 long roleId); 178 179 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 180 public long getGroupScopeActionIds(long companyId, long groupId, 181 java.lang.String name, long roleId); 182 183 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 184 public List<ResourceTypePermission> getGroupScopeResourceTypePermissions( 185 long companyId, java.lang.String name, long roleId); 186 187 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 188 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 189 190 /** 191 * Returns the OSGi service identifier. 192 * 193 * @return the OSGi service identifier 194 */ 195 public java.lang.String getOSGiServiceIdentifier(); 196 197 @Override 198 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 199 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 200 throws PortalException; 201 202 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 203 public ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer( 204 long companyId, long groupId, java.lang.String name); 205 206 /** 207 * Returns the resource type permission with the primary key. 208 * 209 * @param resourceTypePermissionId the primary key of the resource type permission 210 * @return the resource type permission 211 * @throws PortalException if a resource type permission with the primary key could not be found 212 */ 213 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 214 public ResourceTypePermission getResourceTypePermission( 215 long resourceTypePermissionId) throws PortalException; 216 217 /** 218 * Returns a range of all the resource type permissions. 219 * 220 * <p> 221 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 222 * </p> 223 * 224 * @param start the lower bound of the range of resource type permissions 225 * @param end the upper bound of the range of resource type permissions (not inclusive) 226 * @return the range of resource type permissions 227 */ 228 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 229 public List<ResourceTypePermission> getResourceTypePermissions(int start, 230 int end); 231 232 /** 233 * Returns the number of resource type permissions. 234 * 235 * @return the number of resource type permissions 236 */ 237 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 238 public int getResourceTypePermissionsCount(); 239 240 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 241 public List<ResourceTypePermission> getRoleResourceTypePermissions( 242 long roleId); 243 244 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 245 public boolean hasCompanyScopePermission(long companyId, 246 java.lang.String name, long roleId, java.lang.String actionId) 247 throws PortalException; 248 249 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 250 public boolean hasEitherScopePermission(long companyId, 251 java.lang.String name, long roleId, java.lang.String actionId) 252 throws PortalException; 253 254 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 255 public boolean hasGroupScopePermission(long companyId, long groupId, 256 java.lang.String name, long roleId, java.lang.String actionId) 257 throws PortalException; 258 259 public void updateCompanyScopeResourceTypePermissions(long companyId, 260 java.lang.String name, long roleId, long actionIdsLong, long operator); 261 262 public void updateGroupScopeResourceTypePermissions(long companyId, 263 long groupId, java.lang.String name, long roleId, long actionIdsLong, 264 long operator); 265 266 /** 267 * Updates the resource type permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 268 * 269 * @param resourceTypePermission the resource type permission 270 * @return the resource type permission that was updated 271 */ 272 @Indexable(type = IndexableType.REINDEX) 273 public ResourceTypePermission updateResourceTypePermission( 274 ResourceTypePermission resourceTypePermission); 275 }