View Javadoc

1   /*
2    * Copyright 2000-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.portals.graffito.model;
17  
18  import java.util.Collection;
19  
20  /***
21   * Permission apply to a cms object like view, update, delete, ... 
22   * The permission can be apply :
23   * 	- Only on the cms object itself
24   *  - on the object and its children
25   *  - Recursively on all children and subfolders   
26   * 
27   * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
28   * @version $Id: Exp $
29   */
30  public interface CmsPermission 
31  {
32      
33      /*** View a cms object */
34      static public final String VIEW = "view";
35      /*** Edit a cms object */    
36      static public final String EDIT = "edit";
37      /*** Lock a cms object */
38      static public final String LOCK = "lock";
39      /*** Unlock a cms object */
40      static public final String UNLOCK = "unlock";
41      /*** Delete a cms object */
42      static public final String DELETE = "delete";
43      /*** Insert a cms object */
44      static public final String INSERT = "insert";
45      /*** Update a cms object */
46      static public final String UPDATE = "update";    
47      /*** All action authorized on a cms object */
48      static public final String ALL = "all";    
49  
50      /***
51       * Get the permission name. 
52       * The name match to the cms object uri. 
53       * The name contains an "*" if this permission has to be apply on children
54       * The name contains an "-" if this permission has to be apply recusively
55       * @return The permission name
56       */
57      public String getName();
58      
59      /***
60       * Get the action allowed by this permission (view, delete, ...)
61       * "all" can be used to apply all permission on the cms object
62       * @return the allowed actions
63       */
64      public String getActions();
65      
66      
67      /***
68       * Get all principals assigned to this permissions 
69       * @return the the principal full paths (eg. /users/christophe, /groups/admin, ...)
70       */
71      public Collection getPrincipalFullPaths();
72      
73      /***
74       * Check if the permission is applying recursivly on all subfolder
75       * 
76       */
77      public boolean isRecursive();
78      
79      public boolean isApplyToChildren();
80      
81  }