KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.Set JavaDoc;
20
21 import org.alfresco.repo.security.permissions.PermissionEntry;
22 import org.alfresco.repo.security.permissions.PermissionReference;
23 import org.alfresco.service.cmr.repository.NodeRef;
24 import org.alfresco.service.namespace.QName;
25
26 /**
27  * The API for the alfresco permission model.
28  *
29  * @author Andy Hind
30  */

31 public interface ModelDAO
32 {
33
34     /**
35      * Get the permissions that can be set for the given type.
36      *
37      * @param type - the type in the data dictionary.
38      * @return
39      */

40     public Set JavaDoc<PermissionReference> getAllPermissions(QName type);
41
42     /**
43      * Get the permissions that can be set for the given node.
44      * This is determined by the node type.
45      *
46      * @param nodeRef
47      * @return
48      */

49     public Set JavaDoc<PermissionReference> getAllPermissions(NodeRef nodeRef);
50     
51     /**
52      *Get the permissions that are exposed to be set for the given type.
53      *
54      * @param type - the type in the data dictionary.
55      * @return
56      */

57     public Set JavaDoc<PermissionReference> getExposedPermissions(QName type);
58
59     /**
60      * Get the permissions that are exposed to be set for the given node.
61      * This is determined by the node type.
62      *
63      * @param nodeRef
64      * @return
65      */

66     public Set JavaDoc<PermissionReference> getExposedPermissions(NodeRef nodeRef);
67
68     /**
69      * Get all the permissions that grant this permission.
70      *
71      * @param perm
72      * @return
73      */

74     public Set JavaDoc<PermissionReference> getGrantingPermissions(PermissionReference perm);
75
76     /**
77      * Get the permissions that must also be present on the node for the required permission to apply.
78      *
79      * @param required
80      * @param qName
81      * @param aspectQNames
82      * @param on
83      * @return
84      */

85     public Set JavaDoc<PermissionReference> getRequiredPermissions(PermissionReference required, QName qName, Set JavaDoc<QName> aspectQNames, RequiredPermission.On on);
86
87     /**
88      * Get the permissions which are granted by the supplied permission.
89      *
90      * @param permissionReference
91      * @return
92      */

93     public Set JavaDoc<PermissionReference> getGranteePermissions(PermissionReference permissionReference);
94
95     /**
96      * Is this permission refernece to a permission and not a permissoinSet?
97      *
98      * @param required
99      * @return
100      */

101     public boolean checkPermission(PermissionReference required);
102
103     /**
104      * Does the permission reference have a unique name?
105      *
106      * @param permissionReference
107      * @return
108      */

109     public boolean isUnique(PermissionReference permissionReference);
110
111     /**
112      * Find a permission by name in the type context.
113      * If the context is null and the permission name is unique it will be found.
114      *
115      * @param qname
116      * @param permissionName
117      * @return
118      */

119     public PermissionReference getPermissionReference(QName qname, String JavaDoc permissionName);
120     
121     /**
122      * Get the global permissions for the model.
123      * Permissions that apply to all nodes and take precedence over node specific permissions.
124      *
125      * @return
126      */

127     public Set JavaDoc<? extends PermissionEntry> getGlobalPermissionEntries();
128
129 }
130
Popular Tags