KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > security > permissions > PermissionServiceSPI


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;
18
19 import java.util.Set JavaDoc;
20
21 import org.alfresco.service.cmr.repository.NodeRef;
22 import org.alfresco.service.cmr.security.AccessStatus;
23 import org.alfresco.service.cmr.security.PermissionService;
24 import org.alfresco.service.namespace.QName;
25
26 /**
27  * The public API for a permission service
28  *
29  * The implementation may be changed in the application configuration
30  *
31  * @author Andy Hind
32  */

33 public interface PermissionServiceSPI extends PermissionService
34 {
35     /**
36      * Get the All Permission
37      *
38      * @return the All permission
39      */

40     public PermissionReference getAllPermissionReference();
41      
42     /**
43      * Get the permissions that can be set for a given type
44      *
45      * @param nodeRef
46      * @return
47      */

48     public Set JavaDoc<PermissionReference> getSettablePermissionReferences(QName type);
49     
50     /**
51      * Get the permissions that can be set for a given type
52      *
53      * @param nodeRef
54      * @return
55      */

56     public Set JavaDoc<PermissionReference> getSettablePermissionReferences(NodeRef nodeRef);
57
58     /**
59      * Get the permissions that have been set on the given node (it knows
60      * nothing of the parent permissions)
61      *
62      * @param nodeRef
63      * @return
64      */

65     public NodePermissionEntry getSetPermissions(NodeRef nodeRef);
66
67     /**
68      * Check that the given authentication has a particular permission for the
69      * given node. (The default behaviour is to inherit permissions)
70      *
71      * @param nodeRef
72      * @param perm
73      * @return
74      */

75     public AccessStatus hasPermission(NodeRef nodeRef, PermissionReference perm);
76
77     /**
78      * Where is the permission set that controls the behaviour for the given
79      * permission for the given authentication to access the specified name.
80      *
81      * @param nodeRef
82      * @param auth
83      * @param perm
84      * @return
85      */

86     public NodePermissionEntry explainPermission(NodeRef nodeRef, PermissionReference perm);
87     
88     /**
89      * Delete the permissions defined by the nodePermissionEntry
90      * @param nodePermissionEntry
91      */

92     public void deletePermissions(NodePermissionEntry nodePermissionEntry);
93     
94     /**
95      * Delete a single permission entry
96      * @param permissionEntry
97      */

98     public void deletePermission(PermissionEntry permissionEntry);
99
100     /**
101      * Add or set a permission entry on a node.
102      *
103      * @param permissionEntry
104      */

105     public void setPermission(PermissionEntry permissionEntry);
106     
107     /**
108      * Set the permissions on a node.
109      *
110      * @param nodePermissionEntry
111      */

112     public void setPermission(NodePermissionEntry nodePermissionEntry);
113
114     /**
115      * Get the permission reference for the given data type and permission name.
116      *
117      * @param qname - may be null if the permission name is unique
118      * @param permissionName
119      * @return
120      */

121     public PermissionReference getPermissionReference(QName qname, String JavaDoc permissionName);
122     
123     /**
124      * Get the permission reference by permission name.
125      *
126      * @param permissionName
127      * @return
128      */

129     public PermissionReference getPermissionReference(String JavaDoc permissionName);
130     
131     
132     /**
133      * Get the string that can be used to identify the given permission reference.
134      *
135      * @param permissionReference
136      * @return
137      */

138     public String JavaDoc getPermission(PermissionReference permissionReference);
139     
140     public void deletePermissions(String JavaDoc recipient);
141 }
142
Popular Tags