KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > security > permissions > impl > SimplePermissionEntry


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.security.permissions.impl;
18
19 import org.alfresco.repo.security.permissions.PermissionReference;
20 import org.alfresco.service.cmr.repository.NodeRef;
21 import org.alfresco.service.cmr.security.AccessStatus;
22
23 /**
24  * A simple object representation of a permission entry.
25  *
26  * @author andyh
27  */

28 public final class SimplePermissionEntry extends AbstractPermissionEntry
29 {
30     
31     /*
32      * The node ref to which the permissoin applies
33      */

34     private NodeRef nodeRef;
35     
36     /*
37      * The permission reference - as a simple permission reference
38      */

39     private PermissionReference permissionReference;
40     
41     /*
42      * The authority to which the permission aplies
43      */

44     private String JavaDoc authority;
45     
46     /*
47      * The access mode for the permission
48      */

49     private AccessStatus accessStatus;
50     
51     
52     
53     public SimplePermissionEntry(NodeRef nodeRef, PermissionReference permissionReference, String JavaDoc authority, AccessStatus accessStatus)
54     {
55         super();
56         this.nodeRef = nodeRef;
57         this.permissionReference = permissionReference;
58         this.authority = authority;
59         this.accessStatus = accessStatus;
60     }
61
62     public PermissionReference getPermissionReference()
63     {
64         return permissionReference;
65     }
66
67     public String JavaDoc getAuthority()
68     {
69        return authority;
70     }
71
72     public NodeRef getNodeRef()
73     {
74         return nodeRef;
75     }
76
77     public boolean isDenied()
78     {
79         return accessStatus == AccessStatus.DENIED;
80     }
81
82     public boolean isAllowed()
83     {
84         return accessStatus == AccessStatus.ALLOWED;
85     }
86
87     public AccessStatus getAccessStatus()
88     {
89         return accessStatus;
90     }
91
92 }
93
Popular Tags