]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
f281f4c6dce68008bd71783ccbd8021d88c8b802
[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      * @throws PermissionException
43      * @see CSpaceResource
44      * @see CSpaceAction
45      */
46     public void addPermissions(CSpaceResource res, CSpaceAction action, String[] principals)
47             throws PermissionException;
48
49     /**
50      * removePermission removes permission(s) for given action on given resource involving given principals
51      * @param res
52      * @param action
53      * @param principals
54      * @throws PermissionNotFoundException
55      * @throws PermissionException
56      * @see CSpaceResource
57      * @see CSpaceAction
58      */
59     public void deletePermissions(CSpaceResource res, CSpaceAction action, String[] principals)
60             throws PermissionNotFoundException, PermissionException;
61
62     /**
63      * deletePermissions delete all permissions for given action on given resource
64      * @param res
65      * @param action
66      * @throws PermissionNotFoundException
67      * @throws PermissionException
68      * @see CSpaceResource
69      * @see CSpaceAction
70      */
71     public void deletePermissions(CSpaceResource res, CSpaceAction action)
72             throws PermissionNotFoundException, PermissionException;
73
74     /**
75      * deletePermissions delete all permissions for given resource
76      * @param res
77      * @throws PermissionNotFoundException
78      * @throws PermissionException
79      * @see CSpaceResource
80      */
81     public void deletePermissions(CSpaceResource res)
82             throws PermissionNotFoundException, PermissionException;
83 }