KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > source > helpers > PrincipalSourcePermission


1 /*
2  * Copyright 1999-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.cocoon.components.source.helpers;
17
18 /**
19  * This class represents a source permission for users
20  *
21  * @author <a HREF="mailto:stephan@apache.org">Stephan Michels</a>
22  * @version CVS $Id: PrincipalSourcePermission.java 30932 2004-07-29 17:35:38Z vgritsenko $
23  */

24 public class PrincipalSourcePermission extends AbstractSourcePermission {
25
26     public final static String JavaDoc PRINCIPAL_SELF = "SELF";
27     public final static String JavaDoc PRINCIPAL_ALL = "ALL";
28     public final static String JavaDoc PRINCIPAL_GUEST = "GUEST";
29
30     private String JavaDoc principal;
31
32     /**
33      * Creates a new permission
34      *
35      * @param principal Principal of the permission
36      * @param privilege Privilege of the permission
37      * @param inheritable If the permission is inheritable
38      * @param negative If the permission is negative
39      */

40     public PrincipalSourcePermission(String JavaDoc principal, String JavaDoc privilege,
41                                      boolean inheritable, boolean negative) {
42
43         this.principal = principal;
44         setPrivilege(privilege);
45         setInheritable(inheritable);
46         setNegative(negative);
47     }
48
49     /**
50      * Sets the principal of the permission
51      *
52      * @param principal Principal of the permission
53      */

54     public void setPrincipal(String JavaDoc principal) {
55         this.principal = principal;
56     }
57
58     /**
59      * Returns the principal of the permission
60      *
61      * @return Principal of the permission
62      */

63     public String JavaDoc getPrincipal() {
64         return this.principal;
65     }
66 }
67
Popular Tags