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.model;
16  
17  /**
18   * <a href="RoleConstants.java.html"><b><i>View Source</i></b></a>
19   *
20   * @author Brian Wing Shun Chan
21   */
22  public class RoleConstants {
23  
24      public static final String ADMINISTRATOR = "Administrator";
25  
26      public static final String GUEST = "Guest";
27  
28      public static final String OWNER = "Owner";
29  
30      public static final String POWER_USER = "Power User";
31  
32      public static final String USER = "User";
33  
34      public static final String[] SYSTEM_ROLES = {
35          ADMINISTRATOR, GUEST, OWNER, POWER_USER, USER
36      };
37  
38      public static final String COMMUNITY_ADMINISTRATOR =
39          "Community Administrator";
40  
41      public static final String COMMUNITY_MEMBER = "Community Member";
42  
43      public static final String COMMUNITY_OWNER = "Community Owner";
44  
45      public static final String[] SYSTEM_COMMUNITY_ROLES = {
46          COMMUNITY_ADMINISTRATOR, COMMUNITY_MEMBER, COMMUNITY_OWNER
47      };
48  
49      public static final String ORGANIZATION_ADMINISTRATOR =
50          "Organization Administrator";
51  
52      public static final String ORGANIZATION_MEMBER = "Organization Member";
53  
54      public static final String ORGANIZATION_OWNER = "Organization Owner";
55  
56      public static final String[] SYSTEM_ORGANIZATION_ROLES = {
57          ORGANIZATION_ADMINISTRATOR, ORGANIZATION_MEMBER, ORGANIZATION_OWNER
58      };
59  
60      public static final int TYPE_COMMUNITY = 2;
61  
62      public static final String TYPE_COMMUNITY_LABEL = "community";
63  
64      public static final int TYPE_ORGANIZATION = 3;
65  
66      public static final String TYPE_ORGANIZATION_LABEL = "organization";
67  
68      public static final int TYPE_REGULAR = 1;
69  
70      public static final String TYPE_REGULAR_LABEL = "regular";
71  
72      public static String getTypeLabel(int type) {
73          if (type == TYPE_COMMUNITY) {
74              return TYPE_COMMUNITY_LABEL;
75          }
76          else if (type == TYPE_ORGANIZATION) {
77              return TYPE_ORGANIZATION_LABEL;
78          }
79          else {
80              return TYPE_REGULAR_LABEL;
81          }
82      }
83  
84  }