01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.outerj.daisy.repository.acl;
17:
18: import org.outerx.daisy.x10.AclEntryDocument;
19:
20: /**
21: * An AclEntry specifies the permissions for a certain subject.
22: *
23: * <p>To save modification to this AclEntry, call {@link Acl#save()}
24: * on the containing Acl object.
25: */
26: public interface AclEntry {
27: AclActionType get(AclPermission aclPermission);
28:
29: AccessDetails getDetails(AclPermission aclPermission);
30:
31: void set(AclPermission permission, AclActionType action);
32:
33: void set(AclPermission permission, AclActionType action,
34: AccessDetails accessDetails);
35:
36: /**
37: * Sets all permissions to the specified action.
38: */
39: void setAll(AclActionType action);
40:
41: /**
42: * What's returned here depends on (or should be intrepreted according to)
43: * what {@link #getSubjectType()} returns.
44: *
45: * <ul>
46: * <li>{@link AclSubjectType#USER}: a user id
47: * <li>{@link AclSubjectType#ROLE}: a role id
48: * <li>{@link AclSubjectType#EVERYONE}: -1
49: * </ul>
50: */
51: long getSubjectValue();
52:
53: AclSubjectType getSubjectType();
54:
55: void setSubjectValue(long value);
56:
57: void setSubjectType(AclSubjectType subjectType);
58:
59: AccessDetails createNewDetails();
60:
61: AclEntryDocument getXml();
62: }
|