1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.apache.portals.graffito;
16
17 import java.security.Permissions;
18
19 import org.apache.jetspeed.security.PermissionManager;
20 import org.apache.portals.graffito.exception.ContentManagementException;
21 import org.apache.portals.graffito.model.CmsObject;
22 import org.apache.portals.graffito.model.CmsPermission;
23
24
25
26 /***
27 * Extends the Jetspeed 2 Permission manager in order to manager permission on cms objects
28 *
29 * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
30 * @version $Id: Exp $
31 */
32 public interface ContentPermissionService extends PermissionManager
33 {
34
35 /***
36 * Factory to create a new cms permission object.
37 *
38 * @param name the permission name
39 * @param actions The authorised actions
40 * @return an empty factory created permission.
41 * @throws ContentManagementException
42 */
43 public CmsPermission createPermission(String name, String actions) throws ContentManagementException;
44
45 /***
46 * Get all permissions defined for a cms objects
47 * @param cmsObject the cms object
48 * @return the permissions found
49 */
50 Permissions getPermissions(CmsObject cmsObject);
51
52 /***
53 * Get all permissions defined for a cms objects
54 * @param uri the cms object uri
55 * @return the permissions found
56 */
57 Permissions getPermissions(String uri);
58
59 /***
60 * Grant a CmsPermission to a principal
61 * @param principalFullPath the principal full path (eg. /roles/admin)
62 * @param permission The permission to set
63 * @throws ContentManagementException
64 */
65 public void grantPermission(String principalFullPath, CmsPermission permission) throws ContentManagementException;
66
67 }