1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.PortalException;
18  import com.liferay.portal.SystemException;
19  import com.liferay.portal.kernel.annotation.Isolation;
20  import com.liferay.portal.kernel.annotation.Propagation;
21  import com.liferay.portal.kernel.annotation.Transactional;
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.SystemException;
53  
54      public com.liferay.portal.model.Role createRole(long roleId);
55  
56      public void deleteRole(long roleId)
57          throws com.liferay.portal.PortalException,
58              com.liferay.portal.SystemException;
59  
60      public void deleteRole(com.liferay.portal.model.Role role)
61          throws com.liferay.portal.SystemException;
62  
63      @SuppressWarnings("rawtypes")
64      public java.util.List dynamicQuery(
65          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
66          throws com.liferay.portal.SystemException;
67  
68      @SuppressWarnings("rawtypes")
69      public java.util.List dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
71          int end) throws com.liferay.portal.SystemException;
72  
73      @SuppressWarnings("rawtypes")
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.SystemException;
79  
80      public int dynamicQueryCount(
81          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
82          throws com.liferay.portal.SystemException;
83  
84      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
85      public com.liferay.portal.model.Role getRole(long roleId)
86          throws com.liferay.portal.PortalException,
87              com.liferay.portal.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.SystemException;
92  
93      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
94      public int getRolesCount() throws com.liferay.portal.SystemException;
95  
96      public com.liferay.portal.model.Role updateRole(
97          com.liferay.portal.model.Role role)
98          throws com.liferay.portal.SystemException;
99  
100     public com.liferay.portal.model.Role updateRole(
101         com.liferay.portal.model.Role role, boolean merge)
102         throws com.liferay.portal.SystemException;
103 
104     public com.liferay.portal.model.Role addRole(long userId, long companyId,
105         java.lang.String name, java.lang.String description, int type)
106         throws com.liferay.portal.PortalException,
107             com.liferay.portal.SystemException;
108 
109     public com.liferay.portal.model.Role addRole(long userId, long companyId,
110         java.lang.String name, java.lang.String description, int type,
111         java.lang.String className, long classPK)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException;
114 
115     public void addUserRoles(long userId, long[] roleIds)
116         throws com.liferay.portal.SystemException;
117 
118     public void checkSystemRoles(long companyId)
119         throws com.liferay.portal.PortalException,
120             com.liferay.portal.SystemException;
121 
122     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
123     public com.liferay.portal.model.Role getGroupRole(long companyId,
124         long groupId)
125         throws com.liferay.portal.PortalException,
126             com.liferay.portal.SystemException;
127 
128     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
129     public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
130         long groupId) throws com.liferay.portal.SystemException;
131 
132     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
133     public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
134         long companyId, java.lang.String name, int scope,
135         java.lang.String primKey) throws com.liferay.portal.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.PortalException,
141             com.liferay.portal.SystemException;
142 
143     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144     public java.util.List<com.liferay.portal.model.Role> getRoles(
145         long companyId) throws com.liferay.portal.SystemException;
146 
147     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148     public java.util.List<com.liferay.portal.model.Role> getRoles(
149         long[] roleIds)
150         throws com.liferay.portal.PortalException,
151             com.liferay.portal.SystemException;
152 
153     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
154     public java.util.List<com.liferay.portal.model.Role> getRoles(int type,
155         java.lang.String subtype) throws com.liferay.portal.SystemException;
156 
157     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
158     public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
159         java.lang.String subtype) throws com.liferay.portal.SystemException;
160 
161     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162     public int getSubtypeRolesCount(java.lang.String subtype)
163         throws com.liferay.portal.SystemException;
164 
165     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
166     public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
167         long userId, long groupId) throws com.liferay.portal.SystemException;
168 
169     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170     public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
171         long userId, long groupId) throws com.liferay.portal.SystemException;
172 
173     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174     public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
175         long userId, long groupId) throws com.liferay.portal.SystemException;
176 
177     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178     public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
179         long userId, long[] groupIds) throws com.liferay.portal.SystemException;
180 
181     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182     public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
183         long userId, java.util.List<com.liferay.portal.model.Group> groups)
184         throws com.liferay.portal.SystemException;
185 
186     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
187     public java.util.List<com.liferay.portal.model.Role> getUserRoles(
188         long userId) throws com.liferay.portal.SystemException;
189 
190     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
191     public boolean hasUserRole(long userId, long roleId)
192         throws com.liferay.portal.SystemException;
193 
194     /**
195     * Returns true if the user has the regular role.
196     *
197     * @return true if the user has the regular role
198     */
199     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200     public boolean hasUserRole(long userId, long companyId,
201         java.lang.String name, boolean inherited)
202         throws com.liferay.portal.PortalException,
203             com.liferay.portal.SystemException;
204 
205     /**
206     * Returns true if the user has any one of the specified regular roles.
207     *
208     * @return true if the user has the regular role
209     */
210     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
211     public boolean hasUserRoles(long userId, long companyId,
212         java.lang.String[] names, boolean inherited)
213         throws com.liferay.portal.PortalException,
214             com.liferay.portal.SystemException;
215 
216     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
217     public java.util.List<com.liferay.portal.model.Role> search(
218         long companyId, java.lang.String name, java.lang.String description,
219         java.lang.Integer type, int start, int end,
220         com.liferay.portal.kernel.util.OrderByComparator obc)
221         throws com.liferay.portal.SystemException;
222 
223     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
224     public java.util.List<com.liferay.portal.model.Role> search(
225         long companyId, java.lang.String name, java.lang.String description,
226         java.lang.Integer type,
227         java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
228         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
229         throws com.liferay.portal.SystemException;
230 
231     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
232     public int searchCount(long companyId, java.lang.String name,
233         java.lang.String description, java.lang.Integer type)
234         throws com.liferay.portal.SystemException;
235 
236     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237     public int searchCount(long companyId, java.lang.String name,
238         java.lang.String description, java.lang.Integer type,
239         java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
240         throws com.liferay.portal.SystemException;
241 
242     public void setUserRoles(long userId, long[] roleIds)
243         throws com.liferay.portal.PortalException,
244             com.liferay.portal.SystemException;
245 
246     public void unsetUserRoles(long userId, long[] roleIds)
247         throws com.liferay.portal.PortalException,
248             com.liferay.portal.SystemException;
249 
250     public com.liferay.portal.model.Role updateRole(long roleId,
251         java.lang.String name,
252         java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap,
253         java.lang.String description, java.lang.String subtype)
254         throws com.liferay.portal.PortalException,
255             com.liferay.portal.SystemException;
256 }