Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Policy |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) 2009, Swiss Federal Department of Defence Civil Protection and Sport | |
3 | * (http://www.vbs.admin.ch) | |
4 | * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch) | |
5 | * All rights reserved. | |
6 | * | |
7 | * Licensed under the Open Permis License which accompanies this distribution, | |
8 | * and is available at http://www.openpermis.org/BSDlicenceKent.txt | |
9 | */ | |
10 | package org.openpermis.policy; | |
11 | ||
12 | import java.net.URI; | |
13 | import java.util.List; | |
14 | ||
15 | import org.openpermis.PolicyDecisionPoint; | |
16 | import org.openpermis.Subject; | |
17 | ||
18 | ||
19 | ||
20 | /** | |
21 | * A policy decision point policy for role-based access control. | |
22 | * <p>A policy defines two major sets of rules:</p> | |
23 | * <ul> | |
24 | * <li>Rules that allow certain subjects to assign some roles to other subjects (<em>role | |
25 | * assignment rules</em>).</li> | |
26 | * <li>Rules that define which roles have access to specific actions on specific resources | |
27 | * (<em>target access rules</em>).</li> | |
28 | * </ul> | |
29 | * <p>In order to be valid the following conditions must be met:</p> | |
30 | * <ul> | |
31 | * <li>The policy must have at least one {@link RoleAssignmentRule}.</li> | |
32 | * <li>The policy must have at least one {@link TargetAccessRule}.</li> | |
33 | * </ul> | |
34 | * <p>A policy defines role hierarchies. In order to be useful, polices must have at least one | |
35 | * {@link RoleHierarchy}.</p> | |
36 | * @since 0.1.0 | |
37 | */ | |
38 | public interface Policy | |
39 | extends Part, | |
40 | PolicyDecisionPoint | |
41 | { | |
42 | ||
43 | //---- Methods | |
44 | ||
45 | /** | |
46 | * @since 0.3.0 | |
47 | */ | |
48 | public AccessDecision getAccessDecision ( | |
49 | Subject subject, | |
50 | URI resourceUri, | |
51 | String actionName, | |
52 | List<?> arguments, | |
53 | TimeStamp timeStamp | |
54 | ); | |
55 | ||
56 | } |