KickJava   Java API By Example, From Geeks To Geeks.

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


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.NodePermissionEntry;
20 import org.alfresco.repo.security.permissions.PermissionEntry;
21 import org.alfresco.repo.security.permissions.PermissionReference;
22 import org.alfresco.service.cmr.repository.NodeRef;
23
24 /**
25  * The API for accessing persisted Alfresco permissions.
26  *
27  * @author andyh
28  */

29 public interface PermissionsDAO
30 {
31     /**
32      * Get the permissions that have been set on a given node.
33      *
34      * @param nodeRef
35      * @return
36      */

37     public NodePermissionEntry getPermissions(NodeRef nodeRef);
38
39     /**
40      * Delete all the permissions on a given node.
41      * The node permission and all the permission entries it contains will be deleted.
42      *
43      * @param nodeRef
44      */

45     public void deletePermissions(NodeRef nodeRef);
46
47     /**
48      * Delete all the permissions on a given node.
49      * The node permission and all the permission entries it contains will be deleted.
50      *
51      * @param nodePermissionEntry
52      */

53     public void deletePermissions(NodePermissionEntry nodePermissionEntry);
54
55     
56     /**
57      * Delete as single permission entry.
58      * This deleted one permission on the node. It does not affect the persistence of any other permissions.
59      *
60      * @param permissionEntry
61      */

62     public void deletePermissions(PermissionEntry permissionEntry);
63
64     /**
65      *
66      * Delete as single permission entry, if a match is found.
67      * This deleted one permission on the node. It does not affect the persistence of any other permissions.
68      *
69      * @param nodeRef
70      * @param authority
71      * @param perm
72      * @param allow
73      */

74     public void deletePermissions(NodeRef nodeRef, String JavaDoc authority, PermissionReference perm, boolean allow);
75
76     /**
77      * Set a permission on a node.
78      * If the node has no permissions set then a default node permission (allowing inheritance) will be created to
79      * contain the permission entry.
80      *
81      * @param nodeRef
82      * @param authority
83      * @param perm
84      * @param allow
85      */

86     public void setPermission(NodeRef nodeRef, String JavaDoc authority, PermissionReference perm, boolean allow);
87
88     /**
89      * Create a persisted permission entry given and other representation of a permission entry.
90      *
91      * @param permissionEntry
92      */

93     public void setPermission(PermissionEntry permissionEntry);
94
95     /**
96      * Create a persisted node permission entry given a template object from which to copy.
97      *
98      * @param nodePermissionEntry
99      */

100     public void setPermission(NodePermissionEntry nodePermissionEntry);
101
102     /**
103      * Set the inheritance behaviour for permissions on a given node.
104      *
105      * @param nodeRef
106      * @param inheritParentPermissions
107      */

108     public void setInheritParentPermissions(NodeRef nodeRef, boolean inheritParentPermissions);
109
110     /**
111      * Return the inheritance behaviour for permissions on a given node.
112      *
113      * @param nodeRef
114      * @return inheritParentPermissions
115      */

116     public boolean getInheritParentPermissions(NodeRef nodeRef);
117     
118     /**
119      * Clear all the permissions set for a given authentication
120      *
121      * @param nodeRef
122      * @param authority
123      */

124     public void clearPermission(NodeRef nodeRef, String JavaDoc authority);
125     
126     /**
127      * Remove all permissions for the specvified authority
128      * @param authority
129      */

130     public void deleteAllPermissionsForAuthority(String JavaDoc authority);
131
132 }
133
Popular Tags