001    /**
002     * Copyright (c) 2000-2010 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.annotation.Isolation;
018    import com.liferay.portal.kernel.annotation.Propagation;
019    import com.liferay.portal.kernel.annotation.Transactional;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.kernel.exception.SystemException;
022    
023    /**
024     * <p>
025     * This interface defines the service. The default implementation is
026     * {@link
027     * com.liferay.portal.service.impl.RoleLocalServiceImpl}.
028     * Modify methods in that class and rerun ServiceBuilder to populate this class
029     * and all other generated classes.
030     * </p>
031     *
032     * <p>
033     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
034     * </p>
035     *
036     * @author    Brian Wing Shun Chan
037     * @see       RoleLocalServiceUtil
038     * @generated
039     */
040    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
041            PortalException.class, SystemException.class})
042    public interface RoleLocalService {
043            public com.liferay.portal.model.Role addRole(
044                    com.liferay.portal.model.Role role)
045                    throws com.liferay.portal.kernel.exception.SystemException;
046    
047            public com.liferay.portal.model.Role createRole(long roleId);
048    
049            public void deleteRole(long roleId)
050                    throws com.liferay.portal.kernel.exception.PortalException,
051                            com.liferay.portal.kernel.exception.SystemException;
052    
053            public void deleteRole(com.liferay.portal.model.Role role)
054                    throws com.liferay.portal.kernel.exception.SystemException;
055    
056            @SuppressWarnings("unchecked")
057            public java.util.List dynamicQuery(
058                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
059                    throws com.liferay.portal.kernel.exception.SystemException;
060    
061            @SuppressWarnings("unchecked")
062            public java.util.List dynamicQuery(
063                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
064                    int end) throws com.liferay.portal.kernel.exception.SystemException;
065    
066            @SuppressWarnings("unchecked")
067            public java.util.List dynamicQuery(
068                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
069                    int end,
070                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
071                    throws com.liferay.portal.kernel.exception.SystemException;
072    
073            public long dynamicQueryCount(
074                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
075                    throws com.liferay.portal.kernel.exception.SystemException;
076    
077            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
078            public com.liferay.portal.model.Role getRole(long roleId)
079                    throws com.liferay.portal.kernel.exception.PortalException,
080                            com.liferay.portal.kernel.exception.SystemException;
081    
082            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
083            public java.util.List<com.liferay.portal.model.Role> getRoles(int start,
084                    int end) throws com.liferay.portal.kernel.exception.SystemException;
085    
086            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
087            public int getRolesCount()
088                    throws com.liferay.portal.kernel.exception.SystemException;
089    
090            public com.liferay.portal.model.Role updateRole(
091                    com.liferay.portal.model.Role role)
092                    throws com.liferay.portal.kernel.exception.SystemException;
093    
094            public com.liferay.portal.model.Role updateRole(
095                    com.liferay.portal.model.Role role, boolean merge)
096                    throws com.liferay.portal.kernel.exception.SystemException;
097    
098            public com.liferay.portal.model.Role addRole(long userId, long companyId,
099                    java.lang.String name,
100                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
101                    java.lang.String description, int type)
102                    throws com.liferay.portal.kernel.exception.PortalException,
103                            com.liferay.portal.kernel.exception.SystemException;
104    
105            public com.liferay.portal.model.Role addRole(long userId, long companyId,
106                    java.lang.String name,
107                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
108                    java.lang.String description, int type, java.lang.String className,
109                    long classPK)
110                    throws com.liferay.portal.kernel.exception.PortalException,
111                            com.liferay.portal.kernel.exception.SystemException;
112    
113            public void addUserRoles(long userId, long[] roleIds)
114                    throws com.liferay.portal.kernel.exception.PortalException,
115                            com.liferay.portal.kernel.exception.SystemException;
116    
117            public void checkSystemRoles(long companyId)
118                    throws com.liferay.portal.kernel.exception.PortalException,
119                            com.liferay.portal.kernel.exception.SystemException;
120    
121            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
122            public com.liferay.portal.model.Role getDefaultGroupRole(long groupId)
123                    throws com.liferay.portal.kernel.exception.PortalException,
124                            com.liferay.portal.kernel.exception.SystemException;
125    
126            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
127            public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
128                    long groupId)
129                    throws com.liferay.portal.kernel.exception.SystemException;
130    
131            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
132            public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
133                    long companyId, java.lang.String name, int scope,
134                    java.lang.String primKey)
135                    throws com.liferay.portal.kernel.exception.SystemException;
136    
137            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
138            public com.liferay.portal.model.Role getRole(long companyId,
139                    java.lang.String name)
140                    throws com.liferay.portal.kernel.exception.PortalException,
141                            com.liferay.portal.kernel.exception.SystemException;
142    
143            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144            public java.util.List<com.liferay.portal.model.Role> getRoles(
145                    long companyId)
146                    throws com.liferay.portal.kernel.exception.SystemException;
147    
148            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
149            public java.util.List<com.liferay.portal.model.Role> getRoles(
150                    long[] roleIds)
151                    throws com.liferay.portal.kernel.exception.PortalException,
152                            com.liferay.portal.kernel.exception.SystemException;
153    
154            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155            public java.util.List<com.liferay.portal.model.Role> getRoles(int type,
156                    java.lang.String subtype)
157                    throws com.liferay.portal.kernel.exception.SystemException;
158    
159            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
160            public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
161                    java.lang.String subtype)
162                    throws com.liferay.portal.kernel.exception.SystemException;
163    
164            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165            public int getSubtypeRolesCount(java.lang.String subtype)
166                    throws com.liferay.portal.kernel.exception.SystemException;
167    
168            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
169            public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId)
170                    throws com.liferay.portal.kernel.exception.PortalException,
171                            com.liferay.portal.kernel.exception.SystemException;
172    
173            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174            public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
175                    long userId, long groupId)
176                    throws com.liferay.portal.kernel.exception.SystemException;
177    
178            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
179            public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
180                    long userId, long groupId)
181                    throws com.liferay.portal.kernel.exception.SystemException;
182    
183            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
185                    long userId, long groupId)
186                    throws com.liferay.portal.kernel.exception.SystemException;
187    
188            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
189            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
190                    long userId, long[] groupIds)
191                    throws com.liferay.portal.kernel.exception.SystemException;
192    
193            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
194            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
195                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
196                    throws com.liferay.portal.kernel.exception.SystemException;
197    
198            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
199            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
200                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
201    
202            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
203            public boolean hasUserRole(long userId, long roleId)
204                    throws com.liferay.portal.kernel.exception.SystemException;
205    
206            /**
207            * Returns <code>true</code> if the user has the regular role.
208            *
209            * @return <code>true</code> if the user has the regular role
210            */
211            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
212            public boolean hasUserRole(long userId, long companyId,
213                    java.lang.String name, boolean inherited)
214                    throws com.liferay.portal.kernel.exception.PortalException,
215                            com.liferay.portal.kernel.exception.SystemException;
216    
217            /**
218            * Returns <code>true</code> if the user has any one of the specified
219            * regular roles.
220            *
221            * @return <code>true</code> if the user has the regular role
222            */
223            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
224            public boolean hasUserRoles(long userId, long companyId,
225                    java.lang.String[] names, boolean inherited)
226                    throws com.liferay.portal.kernel.exception.PortalException,
227                            com.liferay.portal.kernel.exception.SystemException;
228    
229            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
230            public java.util.List<com.liferay.portal.model.Role> search(
231                    long companyId, java.lang.String name, java.lang.String description,
232                    java.lang.Integer[] types, int start, int end,
233                    com.liferay.portal.kernel.util.OrderByComparator obc)
234                    throws com.liferay.portal.kernel.exception.SystemException;
235    
236            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237            public java.util.List<com.liferay.portal.model.Role> search(
238                    long companyId, java.lang.String name, java.lang.String description,
239                    java.lang.Integer[] types,
240                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
241                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
242                    throws com.liferay.portal.kernel.exception.SystemException;
243    
244            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
245            public int searchCount(long companyId, java.lang.String name,
246                    java.lang.String description, java.lang.Integer[] types)
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
250            public int searchCount(long companyId, java.lang.String name,
251                    java.lang.String description, java.lang.Integer[] types,
252                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
253                    throws com.liferay.portal.kernel.exception.SystemException;
254    
255            public void setUserRoles(long userId, long[] roleIds)
256                    throws com.liferay.portal.kernel.exception.PortalException,
257                            com.liferay.portal.kernel.exception.SystemException;
258    
259            public void unsetUserRoles(long userId, long[] roleIds)
260                    throws com.liferay.portal.kernel.exception.PortalException,
261                            com.liferay.portal.kernel.exception.SystemException;
262    
263            public com.liferay.portal.model.Role updateRole(long roleId,
264                    java.lang.String name,
265                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
266                    java.lang.String description, java.lang.String subtype)
267                    throws com.liferay.portal.kernel.exception.PortalException,
268                            com.liferay.portal.kernel.exception.SystemException;
269    }