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.kernel.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.model.PersistedModel;
026    import com.liferay.portal.kernel.model.ResourceBlockPermissionsContainer;
027    import com.liferay.portal.kernel.model.ResourceTypePermission;
028    import com.liferay.portal.kernel.search.Indexable;
029    import com.liferay.portal.kernel.search.IndexableType;
030    import com.liferay.portal.kernel.transaction.Isolation;
031    import com.liferay.portal.kernel.transaction.Propagation;
032    import com.liferay.portal.kernel.transaction.Transactional;
033    import com.liferay.portal.kernel.util.OrderByComparator;
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            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
062            public boolean hasCompanyScopePermission(long companyId,
063                    java.lang.String name, long roleId, java.lang.String actionId)
064                    throws PortalException;
065    
066            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
067            public boolean hasEitherScopePermission(long companyId,
068                    java.lang.String name, long roleId, java.lang.String actionId)
069                    throws PortalException;
070    
071            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
072            public boolean hasGroupScopePermission(long companyId, long groupId,
073                    java.lang.String name, long roleId, java.lang.String actionId)
074                    throws PortalException;
075    
076            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
077            public ActionableDynamicQuery getActionableDynamicQuery();
078    
079            public DynamicQuery dynamicQuery();
080    
081            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
082            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
083    
084            /**
085            * @throws PortalException
086            */
087            @Override
088            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
089                    throws PortalException;
090    
091            @Override
092            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
093            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
094                    throws PortalException;
095    
096            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
097            public ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer(
098                    long companyId, long groupId, java.lang.String name);
099    
100            /**
101            * Adds the resource type permission to the database. Also notifies the appropriate model listeners.
102            *
103            * @param resourceTypePermission the resource type permission
104            * @return the resource type permission that was added
105            */
106            @Indexable(type = IndexableType.REINDEX)
107            public ResourceTypePermission addResourceTypePermission(
108                    ResourceTypePermission resourceTypePermission);
109    
110            /**
111            * Creates a new resource type permission with the primary key. Does not add the resource type permission to the database.
112            *
113            * @param resourceTypePermissionId the primary key for the new resource type permission
114            * @return the new resource type permission
115            */
116            public ResourceTypePermission createResourceTypePermission(
117                    long resourceTypePermissionId);
118    
119            /**
120            * Deletes the resource type permission from the database. Also notifies the appropriate model listeners.
121            *
122            * @param resourceTypePermission the resource type permission
123            * @return the resource type permission that was removed
124            */
125            @Indexable(type = IndexableType.DELETE)
126            public ResourceTypePermission deleteResourceTypePermission(
127                    ResourceTypePermission resourceTypePermission);
128    
129            /**
130            * Deletes the resource type permission with the primary key from the database. Also notifies the appropriate model listeners.
131            *
132            * @param resourceTypePermissionId the primary key of the resource type permission
133            * @return the resource type permission that was removed
134            * @throws PortalException if a resource type permission with the primary key could not be found
135            */
136            @Indexable(type = IndexableType.DELETE)
137            public ResourceTypePermission deleteResourceTypePermission(
138                    long resourceTypePermissionId) throws PortalException;
139    
140            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
141            public ResourceTypePermission fetchResourceTypePermission(
142                    long resourceTypePermissionId);
143    
144            /**
145            * Returns the resource type permission with the primary key.
146            *
147            * @param resourceTypePermissionId the primary key of the resource type permission
148            * @return the resource type permission
149            * @throws PortalException if a resource type permission with the primary key could not be found
150            */
151            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
152            public ResourceTypePermission getResourceTypePermission(
153                    long resourceTypePermissionId) throws PortalException;
154    
155            /**
156            * Updates the resource type permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
157            *
158            * @param resourceTypePermission the resource type permission
159            * @return the resource type permission that was updated
160            */
161            @Indexable(type = IndexableType.REINDEX)
162            public ResourceTypePermission updateResourceTypePermission(
163                    ResourceTypePermission resourceTypePermission);
164    
165            /**
166            * Returns the number of resource type permissions.
167            *
168            * @return the number of resource type permissions
169            */
170            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171            public int getResourceTypePermissionsCount();
172    
173            /**
174            * Returns the OSGi service identifier.
175            *
176            * @return the OSGi service identifier
177            */
178            public java.lang.String getOSGiServiceIdentifier();
179    
180            /**
181            * Performs a dynamic query on the database and returns the matching rows.
182            *
183            * @param dynamicQuery the dynamic query
184            * @return the matching rows
185            */
186            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
187    
188            /**
189            * Performs a dynamic query on the database and returns a range of the matching rows.
190            *
191            * <p>
192            * 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.
193            * </p>
194            *
195            * @param dynamicQuery the dynamic query
196            * @param start the lower bound of the range of model instances
197            * @param end the upper bound of the range of model instances (not inclusive)
198            * @return the range of matching rows
199            */
200            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
201                    int end);
202    
203            /**
204            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
205            *
206            * <p>
207            * 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.
208            * </p>
209            *
210            * @param dynamicQuery the dynamic query
211            * @param start the lower bound of the range of model instances
212            * @param end the upper bound of the range of model instances (not inclusive)
213            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
214            * @return the ordered range of matching rows
215            */
216            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
217                    int end, OrderByComparator<T> orderByComparator);
218    
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public List<ResourceTypePermission> getGroupScopeResourceTypePermissions(
221                    long companyId, java.lang.String name, long roleId);
222    
223            /**
224            * Returns a range of all the resource type permissions.
225            *
226            * <p>
227            * 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.
228            * </p>
229            *
230            * @param start the lower bound of the range of resource type permissions
231            * @param end the upper bound of the range of resource type permissions (not inclusive)
232            * @return the range of resource type permissions
233            */
234            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235            public List<ResourceTypePermission> getResourceTypePermissions(int start,
236                    int end);
237    
238            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239            public List<ResourceTypePermission> getRoleResourceTypePermissions(
240                    long roleId);
241    
242            /**
243            * Returns the number of rows matching the dynamic query.
244            *
245            * @param dynamicQuery the dynamic query
246            * @return the number of rows matching the dynamic query
247            */
248            public long dynamicQueryCount(DynamicQuery dynamicQuery);
249    
250            /**
251            * Returns the number of rows matching the dynamic query.
252            *
253            * @param dynamicQuery the dynamic query
254            * @param projection the projection to apply to the query
255            * @return the number of rows matching the dynamic query
256            */
257            public long dynamicQueryCount(DynamicQuery dynamicQuery,
258                    Projection projection);
259    
260            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261            public long getCompanyScopeActionIds(long companyId, java.lang.String name,
262                    long roleId);
263    
264            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
265            public long getGroupScopeActionIds(long companyId, long groupId,
266                    java.lang.String name, long roleId);
267    
268            public void updateCompanyScopeResourceTypePermissions(long companyId,
269                    java.lang.String name, long roleId, long actionIdsLong, long operator);
270    
271            public void updateGroupScopeResourceTypePermissions(long companyId,
272                    long groupId, java.lang.String name, long roleId, long actionIdsLong,
273                    long operator);
274    }