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.security.permission;
16  
17  import com.liferay.portal.model.User;
18  
19  import javax.portlet.PortletRequest;
20  
21  /**
22   * <a href="PermissionChecker.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   */
26  public interface PermissionChecker {
27  
28      public long getCompanyId();
29  
30      public long getOwnerRoleId();
31  
32      public long getUserId();
33  
34      public boolean hasOwnerPermission(
35          long companyId, String name, long primKey, long ownerId,
36          String actionId);
37  
38      public boolean hasOwnerPermission(
39          long companyId, String name, String primKey, long ownerId,
40          String actionId);
41  
42      public boolean hasPermission(
43          long groupId, String name, long primKey, String actionId);
44  
45      public boolean hasPermission(
46          long groupId, String name, String primKey, String actionId);
47  
48      public boolean hasUserPermission(
49          long groupId, String name, String primKey, String actionId,
50          boolean checkAdmin);
51  
52      public void init(User user, boolean checkGuest);
53  
54      public boolean isCommunityAdmin(long groupId);
55  
56      public boolean isCommunityOwner(long groupId);
57  
58      public boolean isCompanyAdmin();
59  
60      public boolean isCompanyAdmin(long companyId);
61  
62      public boolean isOmniadmin();
63  
64      public void resetValues();
65  
66      public void setCheckGuest(boolean checkGuest);
67  
68      public void setValues(PortletRequest portletRequest);
69  
70  }