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:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright 2009 University of California at Berkeley
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
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.
24 package org.collectionspace.services.authorization.spi;
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;
32 * Permission management interface for CSpace services
35 public interface CSpacePermissionManager {
38 * addPermisison adds permission for given action on given resource for given principals
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
47 public void addPermissions(CSpaceResource res, CSpaceAction action, String[] principals, boolean grant)
48 throws PermissionException;
51 * removePermission removes permission(s) for given action on given resource involving given principals
55 * @throws PermissionNotFoundException
56 * @throws PermissionException
60 public void deletePermissions(CSpaceResource res, CSpaceAction action, String[] principals)
61 throws PermissionNotFoundException, PermissionException;
64 * deletePermissions delete all permissions for given action on given resource
67 * @throws PermissionNotFoundException
68 * @throws PermissionException
72 public void deletePermissions(CSpaceResource res, CSpaceAction action)
73 throws PermissionNotFoundException, PermissionException;
76 * deletePermissions delete all permissions for given resource
78 * @throws PermissionNotFoundException
79 * @throws PermissionException
82 public void deletePermissions(CSpaceResource res)
83 throws PermissionNotFoundException, PermissionException;