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.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 static final long[] DEFAULT_ROLE_IDS = new long[] {0};
29  
30      public long getCompanyId();
31  
32      public long getOwnerRoleId();
33  
34      public long[] getRoleIds(long userId, long groupId);
35  
36      public long getUserId();
37  
38      public boolean hasOwnerPermission(
39          long companyId, String name, long primKey, long ownerId,
40          String actionId);
41  
42      public boolean hasOwnerPermission(
43          long companyId, String name, String primKey, long ownerId,
44          String actionId);
45  
46      public boolean hasPermission(
47          long groupId, String name, long primKey, String actionId);
48  
49      public boolean hasPermission(
50          long groupId, String name, String primKey, String actionId);
51  
52      public boolean hasUserPermission(
53          long groupId, String name, String primKey, String actionId,
54          boolean checkAdmin);
55  
56      public void init(User user, boolean checkGuest);
57  
58      public boolean isCommunityAdmin(long groupId);
59  
60      public boolean isCommunityOwner(long groupId);
61  
62      public boolean isCompanyAdmin();
63  
64      public boolean isCompanyAdmin(long companyId);
65  
66      public boolean isOmniadmin();
67  
68      public void resetValues();
69  
70      public void setCheckGuest(boolean checkGuest);
71  
72      public void setValues(PortletRequest portletRequest);
73  
74  }