01: package com.technoetic.xplanner.domain;
02:
03: import java.io.Serializable;
04: import java.security.Principal;
05:
06: public class Role extends DomainObject implements Principal,
07: Serializable {
08: public static final String SYSADMIN = "sysadmin";
09: public static final String ADMIN = "admin";
10: public static final String EDITOR = "editor";
11: public static final String VIEWER = "viewer";
12: private String name;
13: private int left;
14: private int right;
15:
16: Role() {
17: // for Hibernate
18: }
19:
20: public Role(String name) {
21: this .name = name;
22: }
23:
24: public String getName() {
25: return name;
26: }
27:
28: public void setName(String name) {
29: this .name = name;
30: }
31:
32: public String toString() {
33: return name;
34: }
35:
36: public int getLeft() {
37: return left;
38: }
39:
40: public void setLeft(int left) {
41: this .left = left;
42: }
43:
44: public int getRight() {
45: return right;
46: }
47:
48: public void setRight(int right) {
49: this .right = right;
50: }
51:
52: public boolean isSysadmin() {
53: return name.equals(SYSADMIN);
54: }
55:
56: public String getDescription() {
57: return "";
58: }
59: }
|