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.AclResultDocument;
19:
20: /**
21: * An object holding information about the evaluation of the ACL rules for a certain
22: * user and/or role combination, for a certain document.
23: *
24: * <p>Provides not only information about the resulting permissions, but also about
25: * why they were granted or denied.
26: */
27: public interface AclResultInfo {
28:
29: public void set(AclPermission permission, AclActionType action,
30: String objectExpr, String subjectReason);
31:
32: public void set(AclPermission permission, AclActionType action,
33: AccessDetails details, String objectExpr,
34: String subjectReason);
35:
36: public AclActionType getActionType(AclPermission permission);
37:
38: public AccessDetails getAccessDetails(AclPermission permission);
39:
40: public boolean isAllowed(AclPermission permission);
41:
42: public boolean isFullyAllowed(AclPermission permission);
43:
44: public boolean isNonLiveAllowed(AclPermission permission);
45:
46: public String getObjectExpr(AclPermission permission);
47:
48: public String getSubjectReason(AclPermission permission);
49:
50: public long getUserId();
51:
52: public long[] getRoleIds();
53:
54: public String getDocumentId();
55:
56: public long getBranchId();
57:
58: public long getLanguageId();
59:
60: public AclResultDocument getXml();
61:
62: public void setFromXml(AclResultDocument.AclResult aclResultXml);
63:
64: public AclResultInfo clone() throws CloneNotSupportedException;
65:
66: /**
67: * Returns a compact string representation of the most useful access information.
68: */
69: public String getCompactString();
70: }
|