1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service;
21  
22  import com.liferay.portal.PortalException;
23  import com.liferay.portal.SystemException;
24  import com.liferay.portal.kernel.annotation.Propagation;
25  import com.liferay.portal.kernel.annotation.Transactional;
26  
27  /**
28   * <a href="RoleLocalService.java.html"><b><i>View Source</i></b></a>
29   *
30   * <p>
31   * ServiceBuilder generated this class. Modifications in this class will be
32   * overwritten the next time is generated.
33   * </p>
34   *
35   * <p>
36   * This interface defines the service. The default implementation is
37   * <code>com.liferay.portal.service.impl.RoleLocalServiceImpl</code>.
38   * Modify methods in that class and rerun ServiceBuilder to populate this class
39   * and all other generated classes.
40   * </p>
41   *
42   * <p>
43   * 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.
44   * </p>
45   *
46   * @author Brian Wing Shun Chan
47   *
48   * @see com.liferay.portal.service.RoleLocalServiceUtil
49   *
50   */
51  @Transactional(rollbackFor =  {
52      PortalException.class, SystemException.class})
53  public interface RoleLocalService {
54      public com.liferay.portal.model.Role addRole(
55          com.liferay.portal.model.Role role)
56          throws com.liferay.portal.SystemException;
57  
58      public com.liferay.portal.model.Role createRole(long roleId);
59  
60      public void deleteRole(long roleId)
61          throws com.liferay.portal.SystemException,
62              com.liferay.portal.PortalException;
63  
64      public void deleteRole(com.liferay.portal.model.Role role)
65          throws com.liferay.portal.SystemException;
66  
67      public java.util.List<Object> dynamicQuery(
68          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
69          throws com.liferay.portal.SystemException;
70  
71      public java.util.List<Object> dynamicQuery(
72          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
73          int end) throws com.liferay.portal.SystemException;
74  
75      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
76      public com.liferay.portal.model.Role getRole(long roleId)
77          throws com.liferay.portal.SystemException,
78              com.liferay.portal.PortalException;
79  
80      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
81      public java.util.List<com.liferay.portal.model.Role> getRoles(int start,
82          int end) throws com.liferay.portal.SystemException;
83  
84      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
85      public int getRolesCount() throws com.liferay.portal.SystemException;
86  
87      public com.liferay.portal.model.Role updateRole(
88          com.liferay.portal.model.Role role)
89          throws com.liferay.portal.SystemException;
90  
91      public com.liferay.portal.model.Role addRole(long userId, long companyId,
92          java.lang.String name, java.lang.String description, int type)
93          throws com.liferay.portal.PortalException,
94              com.liferay.portal.SystemException;
95  
96      public com.liferay.portal.model.Role addRole(long userId, long companyId,
97          java.lang.String name, java.lang.String description, int type,
98          java.lang.String className, long classPK)
99          throws com.liferay.portal.PortalException,
100             com.liferay.portal.SystemException;
101 
102     public void addUserRoles(long userId, long[] roleIds)
103         throws com.liferay.portal.SystemException;
104 
105     public void checkSystemRoles(long companyId)
106         throws com.liferay.portal.PortalException,
107             com.liferay.portal.SystemException;
108 
109     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
110     public com.liferay.portal.model.Role getGroupRole(long companyId,
111         long groupId)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException;
114 
115     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
116     public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
117         long groupId) throws com.liferay.portal.SystemException;
118 
119     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
120     public java.util.Map<String, java.util.List<String>> getResourceRoles(
121         long companyId, java.lang.String name, int scope,
122         java.lang.String primKey) throws com.liferay.portal.SystemException;
123 
124     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
125     public com.liferay.portal.model.Role getRole(long companyId,
126         java.lang.String name)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException;
129 
130     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
131     public java.util.List<com.liferay.portal.model.Role> getRoles(
132         long companyId) throws com.liferay.portal.SystemException;
133 
134     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
135     public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
136         long userId, long groupId) throws com.liferay.portal.SystemException;
137 
138     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
139     public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
140         long userId, long groupId) throws com.liferay.portal.SystemException;
141 
142     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
143     public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
144         long userId, long[] groupIds) throws com.liferay.portal.SystemException;
145 
146     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
147     public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
148         long userId, java.util.List<com.liferay.portal.model.Group> groups)
149         throws com.liferay.portal.SystemException;
150 
151     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
152     public java.util.List<com.liferay.portal.model.Role> getUserRoles(
153         long userId) throws com.liferay.portal.SystemException;
154 
155     public boolean hasUserRole(long userId, long roleId)
156         throws com.liferay.portal.SystemException;
157 
158     public boolean hasUserRole(long userId, long companyId,
159         java.lang.String name, boolean inherited)
160         throws com.liferay.portal.PortalException,
161             com.liferay.portal.SystemException;
162 
163     public boolean hasUserRoles(long userId, long companyId,
164         java.lang.String[] names, boolean inherited)
165         throws com.liferay.portal.PortalException,
166             com.liferay.portal.SystemException;
167 
168     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
169     public java.util.List<com.liferay.portal.model.Role> search(
170         long companyId, java.lang.String name, java.lang.String description,
171         java.lang.Integer type, int start, int end,
172         com.liferay.portal.kernel.util.OrderByComparator obc)
173         throws com.liferay.portal.SystemException;
174 
175     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
176     public java.util.List<com.liferay.portal.model.Role> search(
177         long companyId, java.lang.String name, java.lang.String description,
178         java.lang.Integer type, java.util.LinkedHashMap<String, Object> params,
179         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
180         throws com.liferay.portal.SystemException;
181 
182     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
183     public int searchCount(long companyId, java.lang.String name,
184         java.lang.String description, java.lang.Integer type)
185         throws com.liferay.portal.SystemException;
186 
187     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
188     public int searchCount(long companyId, java.lang.String name,
189         java.lang.String description, java.lang.Integer type,
190         java.util.LinkedHashMap<String, Object> params)
191         throws com.liferay.portal.SystemException;
192 
193     public void setUserRoles(long userId, long[] roleIds)
194         throws com.liferay.portal.SystemException;
195 
196     public void unsetUserRoles(long userId, long[] roleIds)
197         throws com.liferay.portal.SystemException;
198 
199     public com.liferay.portal.model.Role updateRole(long roleId,
200         java.lang.String name, java.lang.String description)
201         throws com.liferay.portal.PortalException,
202             com.liferay.portal.SystemException;
203 }