1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.common.rice.authorization; |
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | 0 | public enum PermissionType { |
23 | 0 | INITIATE("Initiate","KR-SYS","Initiate Document"),OPEN("View","KS-SYS","Open Document"),EDIT("Edit","KS-SYS","Edit Document"), |
24 | 0 | ADD_COMMENT("Comment","KS-SYS","Comment on Document"),ADD_ADHOC_REVIEWER("Add Reviewer","KS-SYS","Add Adhoc Reviewer"), WITHDRAW("Withdraw","KS-SYS","Withdraw Document"), |
25 | 0 | SECTION_MAINTENANCE("Section Maintenance","KS-SYS","Section Maintenance"), FIELD_ACCESS("Access Permission","KS-SYS","Access Permission"), SEARCH("Lookup",null,null), |
26 | 0 | REMOVE_ADHOC_REVIEWERS("Remove Reviewers","KS-SYS","Remove Reviewers"), BLANKET_APPROVE("Blanket Approve","KS-SYS","Blanket Approve"), |
27 | 0 | UPLOAD_DOCUMENTS("Upload","KS-SYS","Upload to Document"); |
28 | |
|
29 | 0 | private String label = ""; |
30 | 0 | private String permissionNamespace = ""; |
31 | 0 | private String permissionTemplateName = ""; |
32 | |
|
33 | 0 | private PermissionType(String label, String permissionNamespace, String permissionTemplateName) { |
34 | 0 | this.label = label; |
35 | 0 | this.permissionNamespace = permissionNamespace; |
36 | 0 | this.permissionTemplateName = permissionTemplateName; |
37 | 0 | } |
38 | |
|
39 | |
public String getLabel() { |
40 | 0 | return label; |
41 | |
} |
42 | |
|
43 | |
public void setLabel(String label) { |
44 | 0 | this.label = label; |
45 | 0 | } |
46 | |
|
47 | |
public String getPermissionNamespace() { |
48 | 0 | return permissionNamespace; |
49 | |
} |
50 | |
|
51 | |
public void setPermissionNamespace(String permissionNamespace) { |
52 | 0 | this.permissionNamespace = permissionNamespace; |
53 | 0 | } |
54 | |
|
55 | |
public String getPermissionTemplateName() { |
56 | 0 | return permissionTemplateName; |
57 | |
} |
58 | |
|
59 | |
public void setPermissionTemplateName(String permissionTemplateName) { |
60 | 0 | this.permissionTemplateName = permissionTemplateName; |
61 | 0 | } |
62 | |
|
63 | |
public String getCode() { |
64 | 0 | return permissionNamespace + "~" + permissionTemplateName; |
65 | |
} |
66 | |
|
67 | |
public static PermissionType getByCode(String code) { |
68 | 0 | for (PermissionType type : PermissionType.values()) { |
69 | 0 | if (type.getCode().equals(code)) { |
70 | 0 | return type; |
71 | |
} |
72 | |
} |
73 | 0 | return null; |
74 | |
} |
75 | |
|
76 | |
@Override |
77 | |
public String toString() { |
78 | 0 | return label; |
79 | |
} |
80 | |
} |