]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
b8f0f30de1b4d4bcb6952800a559fb9dea06a23f
[tmp/jakarta-migration.git] /
1 /**
2  *  This document is a part of the source code and related artifacts
3  *  for CollectionSpace, an open source collections management system
4  *  for museums and related institutions:
5
6  *  http://www.collectionspace.org
7  *  http://wiki.collectionspace.org
8
9  *  Copyright 2009 University of California at Berkeley
10
11  *  Licensed under the Educational Community License (ECL), Version 2.0.
12  *  You may not use this file except in compliance with this License.
13
14  *  You may obtain a copy of the ECL 2.0 License at
15
16  *  https://source.collectionspace.org/collection-space/LICENSE.txt
17
18  *  Unless required by applicable law or agreed to in writing, software
19  *  distributed under the License is distributed on an "AS IS" BASIS,
20  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  *  See the License for the specific language governing permissions and
22  *  limitations under the License.
23  */
24 package org.collectionspace.services.authorization.spi;
25
26 import org.collectionspace.services.authorization.CSpaceResource;
27 import org.collectionspace.services.authorization.CSpaceAction;
28 import org.collectionspace.services.authorization.PermissionException;
29 import org.collectionspace.services.authorization.PermissionNotFoundException;
30
31 /**
32  * Permission management interface for CSpace services
33  * @author 
34  */
35 public interface CSpacePermissionManager {
36
37     /**
38      * addPermisison adds permission for given action on given resource for given principals
39      * @param res resource
40      * @param principals an array of principal names
41      * @action action on the resource
42      * @grant true to grant, false to deny
43      * @throws PermissionException
44      * @see CSpaceResource
45      * @see CSpaceAction
46      */
47     public void addPermissionsToRoles(CSpaceResource res, CSpaceAction action, String[] principals, boolean grant)
48             throws PermissionException;
49
50     /**
51      * removePermission removes permission(s) for given action on given resource involving given principals
52      * @param res
53      * @param action
54      * @param principals
55      * @throws PermissionNotFoundException
56      * @throws PermissionException
57      * @see CSpaceResource
58      * @see CSpaceAction
59      */
60     public void deletePermissionsFromRoles(CSpaceResource res, CSpaceAction action, String[] principals)
61             throws PermissionNotFoundException, PermissionException;
62
63     /**
64      * deletePermissions delete all permissions for given action on given resource
65      * @param res
66      * @param action
67      * @throws PermissionNotFoundException
68      * @throws PermissionException
69      * @see CSpaceResource
70      * @see CSpaceAction
71      */
72     public void deletePermissions(CSpaceResource res, CSpaceAction action)
73             throws PermissionNotFoundException, PermissionException;
74
75     /**
76      * deletePermissions delete all permissions for given resource
77      * @param res
78      * @throws PermissionNotFoundException
79      * @throws PermissionException
80      * @see CSpaceResource
81      */
82     public void deletePermissions(CSpaceResource res)
83             throws PermissionNotFoundException, PermissionException;
84 }