KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snipsnap > user > Permission


1 /* Compent
2  * This file is part of "SnipSnap Wiki/Weblog".
3  *
4  * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
5  * All Rights Reserved.
6  *
7  * Please visit http://snipsnap.org/ for updates and contact.
8  *
9  * --LICENSE NOTICE--
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  * --LICENSE NOTICE--
24  */

25 package org.snipsnap.user;
26
27 /**
28  * Permission to do something.
29  *
30  * @author Stephan J. Schmidt
31  * @version $Id: Permission.java 1257 2003-12-11 13:36:55Z leo $
32  */

33
34 public class Permission {
35   public final static Permission EDIT_SNIP = new Permission("EDIT_SNIP");
36   public final static Permission ATTACH_TO_SNIP = new Permission("ATTACH_TO_SNIP");
37   public final static Permission POST_TO_SNIP = new Permission("POST_TO_SNIP");
38   public final static Permission CREATE_SNIP = new Permission("CREATE_SNIP");
39   public final static Permission REMOVE_SNIP = new Permission("REMOVE_SNIP");
40   public final static Permission VIEW_SNIP = new Permission("VIEW_SNIP");
41   public final static Permission POST_COMMENT = new Permission("POST_COMMENT");
42   public final static Permission EDIT_COMMENT = new Permission("EDIT_COMMENT");
43   public final static Permission LOCK_SNIP = new Permission("LOCK_SNIP");
44   public final static Permission VIEW_ATTACHMENTS = new Permission("VIEW_ATTACHMENTS");
45   public final static Permission VIEW_LABELS = new Permission("VIEW_LABELS");
46
47   private String JavaDoc permission;
48
49   public Permission(String JavaDoc permission) {
50     this.permission = permission;
51   }
52
53   public int hashCode() {
54     return permission.hashCode();
55   }
56
57   public boolean equals(Object JavaDoc obj) {
58     return permission.equals(obj);
59   }
60
61   public String JavaDoc toString() {
62     return permission;
63   }
64 }
65
66
Popular Tags