01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18: package org.apache.lenya.ac;
19:
20: /**
21: * Modifiable policy.
22: */
23: public interface ModifiablePolicy extends Policy {
24:
25: /**
26: * Sets if this policy requires SSL protection.
27: *
28: * @param ssl
29: * A boolean value.
30: */
31: void setSSL(boolean ssl);
32:
33: /**
34: * Adds a role to this policy for a certain accreditable and a certain role.
35: * If a credenital exists for the accreditable, the role is added to this
36: * credential. Otherwise, a new credential is created.
37: *
38: * @param accreditable
39: * An accreditable.
40: * @param role
41: * A role.
42: * @param method
43: */
44: public void addRole(Accreditable accreditable, Role role,
45: String method);
46:
47: /**
48: * Removes a role from this policy for a certain accreditable and a certain
49: * role.
50: *
51: * @param accreditable
52: * An accreditable.
53: * @param role
54: * A role.
55: * @throws AccessControlException
56: * if the accreditable-role pair is not contained.
57: */
58: public void removeRole(Accreditable accreditable, Role role)
59: throws AccessControlException;
60:
61: /**
62: * Removes all roles from this policy for a certain accreditable.
63: *
64: * @param accreditable
65: * An accreditable.
66: * @throws AccessControlException
67: * if the accreditable-role pair is not contained.
68: */
69: void removeRoles(Accreditable accreditable)
70: throws AccessControlException;
71:
72: /**
73: * Moves a role up the credential tree, giving it higher priority.
74: *
75: * @param accreditable
76: * @param role
77: * @throws AccessControlException
78: */
79: public void moveRoleUp(Accreditable accreditable, Role role)
80: throws AccessControlException;
81:
82: /**
83: * Moves a role down the credential tree, decreasing its priority.
84: *
85: * @param accreditable
86: * @param role
87: * @throws AccessControlException
88: */
89: public void moveRoleDown(Accreditable accreditable, Role role)
90: throws AccessControlException;
91:
92: }
|