1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.annotation.Isolation;
18  import com.liferay.portal.kernel.annotation.Propagation;
19  import com.liferay.portal.kernel.annotation.Transactional;
20  import com.liferay.portal.kernel.exception.PortalException;
21  import com.liferay.portal.kernel.exception.SystemException;
22  
23  /**
24   * <a href="RoleLocalService.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This interface defines the service. The default implementation is
33   * {@link
34   * com.liferay.portal.service.impl.RoleLocalServiceImpl}}.
35   * Modify methods in that class and rerun ServiceBuilder to populate this class
36   * and all other generated classes.
37   * </p>
38   *
39   * <p>
40   * 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.
41   * </p>
42   *
43   * @author    Brian Wing Shun Chan
44   * @see       RoleLocalServiceUtil
45   * @generated
46   */
47  @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
48      PortalException.class, SystemException.class})
49  public interface RoleLocalService {
50      public com.liferay.portal.model.Role addRole(
51          com.liferay.portal.model.Role role)
52          throws com.liferay.portal.kernel.exception.SystemException;
53  
54      public com.liferay.portal.model.Role createRole(long roleId);
55  
56      public void deleteRole(long roleId)
57          throws com.liferay.portal.kernel.exception.PortalException,
58              com.liferay.portal.kernel.exception.SystemException;
59  
60      public void deleteRole(com.liferay.portal.model.Role role)
61          throws com.liferay.portal.kernel.exception.SystemException;
62  
63      @SuppressWarnings("unchecked")
64      public java.util.List dynamicQuery(
65          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
66          throws com.liferay.portal.kernel.exception.SystemException;
67  
68      @SuppressWarnings("unchecked")
69      public java.util.List dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
71          int end) throws com.liferay.portal.kernel.exception.SystemException;
72  
73      @SuppressWarnings("unchecked")
74      public java.util.List dynamicQuery(
75          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
76          int end,
77          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
78          throws com.liferay.portal.kernel.exception.SystemException;
79  
80      public long dynamicQueryCount(
81          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
82          throws com.liferay.portal.kernel.exception.SystemException;
83  
84      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
85      public com.liferay.portal.model.Role getRole(long roleId)
86          throws com.liferay.portal.kernel.exception.PortalException,
87              com.liferay.portal.kernel.exception.SystemException;
88  
89      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
90      public java.util.List<com.liferay.portal.model.Role> getRoles(int start,
91          int end) throws com.liferay.portal.kernel.exception.SystemException;
92  
93      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
94      public int getRolesCount()
95          throws com.liferay.portal.kernel.exception.SystemException;
96  
97      public com.liferay.portal.model.Role updateRole(
98          com.liferay.portal.model.Role role)
99          throws com.liferay.portal.kernel.exception.SystemException;
100 
101     public com.liferay.portal.model.Role updateRole(
102         com.liferay.portal.model.Role role, boolean merge)
103         throws 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)
109         throws com.liferay.portal.kernel.exception.PortalException,
110             com.liferay.portal.kernel.exception.SystemException;
111 
112     public com.liferay.portal.model.Role addRole(long userId, long companyId,
113         java.lang.String name,
114         java.util.Map<java.util.Locale, java.lang.String> titleMap,
115         java.lang.String description, int type, java.lang.String className,
116         long classPK)
117         throws com.liferay.portal.kernel.exception.PortalException,
118             com.liferay.portal.kernel.exception.SystemException;
119 
120     public void addUserRoles(long userId, long[] roleIds)
121         throws com.liferay.portal.kernel.exception.PortalException,
122             com.liferay.portal.kernel.exception.SystemException;
123 
124     public void checkSystemRoles(long companyId)
125         throws com.liferay.portal.kernel.exception.PortalException,
126             com.liferay.portal.kernel.exception.SystemException;
127 
128     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
129     public com.liferay.portal.model.Role getDefaultGroupRole(long groupId)
130         throws com.liferay.portal.kernel.exception.PortalException,
131             com.liferay.portal.kernel.exception.SystemException;
132 
133     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134     public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
135         long groupId)
136         throws com.liferay.portal.kernel.exception.SystemException;
137 
138     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
139     public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
140         long companyId, java.lang.String name, int scope,
141         java.lang.String primKey)
142         throws com.liferay.portal.kernel.exception.SystemException;
143 
144     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
145     public com.liferay.portal.model.Role getRole(long companyId,
146         java.lang.String name)
147         throws com.liferay.portal.kernel.exception.PortalException,
148             com.liferay.portal.kernel.exception.SystemException;
149 
150     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
151     public java.util.List<com.liferay.portal.model.Role> getRoles(
152         long companyId)
153         throws com.liferay.portal.kernel.exception.SystemException;
154 
155     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
156     public java.util.List<com.liferay.portal.model.Role> getRoles(
157         long[] roleIds)
158         throws com.liferay.portal.kernel.exception.PortalException,
159             com.liferay.portal.kernel.exception.SystemException;
160 
161     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162     public java.util.List<com.liferay.portal.model.Role> getRoles(int type,
163         java.lang.String subtype)
164         throws com.liferay.portal.kernel.exception.SystemException;
165 
166     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
167     public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
168         java.lang.String subtype)
169         throws com.liferay.portal.kernel.exception.SystemException;
170 
171     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
172     public int getSubtypeRolesCount(java.lang.String subtype)
173         throws com.liferay.portal.kernel.exception.SystemException;
174 
175     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
176     public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId)
177         throws com.liferay.portal.kernel.exception.PortalException,
178             com.liferay.portal.kernel.exception.SystemException;
179 
180     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
181     public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
182         long userId, long groupId)
183         throws com.liferay.portal.kernel.exception.SystemException;
184 
185     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186     public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
187         long userId, long groupId)
188         throws com.liferay.portal.kernel.exception.SystemException;
189 
190     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
191     public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
192         long userId, long groupId)
193         throws com.liferay.portal.kernel.exception.SystemException;
194 
195     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196     public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
197         long userId, long[] groupIds)
198         throws com.liferay.portal.kernel.exception.SystemException;
199 
200     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201     public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
202         long userId, java.util.List<com.liferay.portal.model.Group> groups)
203         throws com.liferay.portal.kernel.exception.SystemException;
204 
205     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
206     public java.util.List<com.liferay.portal.model.Role> getUserRoles(
207         long userId) throws com.liferay.portal.kernel.exception.SystemException;
208 
209     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210     public boolean hasUserRole(long userId, long roleId)
211         throws com.liferay.portal.kernel.exception.SystemException;
212 
213     /**
214     * Returns true if the user has the regular role.
215     *
216     * @return true if the user has the regular role
217     */
218     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
219     public boolean hasUserRole(long userId, long companyId,
220         java.lang.String name, boolean inherited)
221         throws com.liferay.portal.kernel.exception.PortalException,
222             com.liferay.portal.kernel.exception.SystemException;
223 
224     /**
225     * Returns true if the user has any one of the specified regular roles.
226     *
227     * @return true if the user has the regular role
228     */
229     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
230     public boolean hasUserRoles(long userId, long companyId,
231         java.lang.String[] names, boolean inherited)
232         throws com.liferay.portal.kernel.exception.PortalException,
233             com.liferay.portal.kernel.exception.SystemException;
234 
235     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236     public java.util.List<com.liferay.portal.model.Role> search(
237         long companyId, java.lang.String name, java.lang.String description,
238         java.lang.Integer[] types, int start, int end,
239         com.liferay.portal.kernel.util.OrderByComparator obc)
240         throws com.liferay.portal.kernel.exception.SystemException;
241 
242     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
243     public java.util.List<com.liferay.portal.model.Role> search(
244         long companyId, java.lang.String name, java.lang.String description,
245         java.lang.Integer[] types,
246         java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
247         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
248         throws com.liferay.portal.kernel.exception.SystemException;
249 
250     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251     public int searchCount(long companyId, java.lang.String name,
252         java.lang.String description, java.lang.Integer[] types)
253         throws com.liferay.portal.kernel.exception.SystemException;
254 
255     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
256     public int searchCount(long companyId, java.lang.String name,
257         java.lang.String description, java.lang.Integer[] types,
258         java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
259         throws com.liferay.portal.kernel.exception.SystemException;
260 
261     public void setUserRoles(long userId, long[] roleIds)
262         throws com.liferay.portal.kernel.exception.PortalException,
263             com.liferay.portal.kernel.exception.SystemException;
264 
265     public void unsetUserRoles(long userId, long[] roleIds)
266         throws com.liferay.portal.kernel.exception.PortalException,
267             com.liferay.portal.kernel.exception.SystemException;
268 
269     public com.liferay.portal.model.Role updateRole(long roleId,
270         java.lang.String name,
271         java.util.Map<java.util.Locale, java.lang.String> titleMap,
272         java.lang.String description, java.lang.String subtype)
273         throws com.liferay.portal.kernel.exception.PortalException,
274             com.liferay.portal.kernel.exception.SystemException;
275 }