This project has retired. For details please refer to its Attic page.
Permission xref
View Javadoc

1   package org.apache.archiva.redback.rbac;
2   
3   /*
4    * Copyright 2001-2006 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  /**
20   * Permission
21   * <p/>
22   * A permission is the wrapper for an operation and a resource effectively saying
23   * that the operation is authorized for that resource.
24   * <p/>
25   * P(Operation, Resource)
26   *
27   * @author Jesse McConnell <jmcconnell@apache.org>
28   * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
29   *
30   */
31  public interface Permission
32  {
33  
34      /**
35       * Long description of the Permission
36       */
37      String getDescription();
38  
39      /**
40       * Get the short name of the permission.
41       * <p/>
42       * NOTE: This field is considered the Primary Key for this object.
43       *
44       * @return the short name for this permission.
45       */
46      String getName();
47  
48      /**
49       * Operation that this permission is authorizing
50       */
51      Operation getOperation();
52  
53      /**
54       * This is the resource associated with this permission.
55       * <p/>
56       * Implementors must always supply a Resource.
57       *
58       * @return the Resource.
59       */
60      Resource getResource();
61  
62      /**
63       * Set null
64       *
65       * @param description
66       */
67      void setDescription( String description );
68  
69      /**
70       * Set the short name for this permission.
71       *
72       * @param name
73       */
74      void setName( String name );
75  
76      /**
77       * Set null
78       *
79       * @param operation
80       */
81      void setOperation( Operation operation );
82  
83      /**
84       * @param resource
85       */
86      void setResource( Resource resource );
87  
88      /**
89       * Test to see if the object is a permanent object or not.
90       *
91       * @return true if the object is permanent.
92       */
93      boolean isPermanent();
94  
95      /**
96       * Set flag indicating if the object is a permanent object or not.
97       *
98       * @param permanent true if the object is permanent.
99       */
100     void setPermanent( boolean permanent );
101 }