1 /*
2 * Licensed to The Apereo Foundation under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work for additional
4 * information regarding copyright ownership.
5 *
6 *
7 * The Apereo Foundation licenses this file to you under the Educational
8 * Community License, Version 2.0 (the "License"); you may not use this file
9 * except in compliance with the License. You may obtain a copy of the License
10 * at:
11 *
12 * http://opensource.org/licenses/ecl2.txt
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17 * License for the specific language governing permissions and limitations under
18 * the License.
19 *
20 */
21
22 package org.opencastproject.security.api;
23
24 /**
25 * Represent a role in Opencast
26 */
27 public interface Role {
28
29 /**
30 * The type of role:
31 * SYSTEM - A role granted automatically by Opencast, not persisted
32 * INTERNAL - A role indicating an ability that the user has within Opencast, persisted
33 * GROUP - A role indicating membership of an Opencast group, persisted
34 * EXTERNAL - A role granted to a user from an external system, not persisted
35 * EXTERNAL_GROUP - A role indicating membership of an Opencast group from an external system, not persisted
36 * DERIVED - A role which is derived from the user's group membership (a role which the group has), not persisted
37 */
38 enum Type {
39 INTERNAL, SYSTEM, GROUP, EXTERNAL, EXTERNAL_GROUP, DERIVED;
40 }
41
42 /**
43 * The target (intended purpose) of a set of roles
44 * USER - Roles which are assigned to users and/or groups to provide access to capabilities
45 * ACL - Roles which are used to manage access to resources (Event, Series) in an ACL
46 * ALL - All roles
47 */
48 enum Target {
49 USER, ACL, ALL;
50 }
51
52 /**
53 * Gets the role name
54 *
55 * @return the role name
56 */
57 String getName();
58
59 /**
60 * Gets the role description
61 *
62 * @return the role description
63 */
64 String getDescription();
65
66 /**
67 * Returns the role's organization identifier.
68 *
69 * @return the organization identifier
70 */
71 String getOrganizationId();
72
73 /**
74 * Returns the role's {@link Type}
75 *
76 * @return the type
77 */
78 Type getType();
79 }