Upgrading Spring Security
[syncope.git] / common / lib / src / main / java / org / apache / syncope / common / lib / types / Entitlement.java
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. 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,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.syncope.common.lib.types;
20
21 import java.lang.reflect.Field;
22 import java.lang.reflect.Modifier;
23 import java.util.Collections;
24 import java.util.HashSet;
25 import java.util.Set;
26
27 public final class Entitlement {
28
29 public static final String ANONYMOUS = "ANONYMOUS";
30
31 public static final String MUST_CHANGE_PASSWORD = "MUST_CHANGE_PASSWORD";
32
33 public static final String DOMAIN_CREATE = "DOMAIN_CREATE";
34
35 public static final String DOMAIN_READ = "DOMAIN_READ";
36
37 public static final String DOMAIN_UPDATE = "DOMAIN_UPDATE";
38
39 public static final String DOMAIN_DELETE = "DOMAIN_DELETE";
40
41 public static final String REALM_LIST = "REALM_LIST";
42
43 public static final String REALM_CREATE = "REALM_CREATE";
44
45 public static final String REALM_UPDATE = "REALM_UPDATE";
46
47 public static final String REALM_DELETE = "REALM_DELETE";
48
49 public static final String ANYTYPECLASS_LIST = "ANYTYPECLASS_LIST";
50
51 public static final String ANYTYPECLASS_CREATE = "ANYTYPECLASS_CREATE";
52
53 public static final String ANYTYPECLASS_READ = "ANYTYPECLASS_READ";
54
55 public static final String ANYTYPECLASS_UPDATE = "ANYTYPECLASS_UPDATE";
56
57 public static final String ANYTYPECLASS_DELETE = "ANYTYPECLASS_DELETE";
58
59 public static final String ANYTYPE_LIST = "ANYTYPE_LIST";
60
61 public static final String ANYTYPE_CREATE = "ANYTYPE_CREATE";
62
63 public static final String ANYTYPE_READ = "ANYTYPE_READ";
64
65 public static final String ANYTYPE_UPDATE = "ANYTYPE_UPDATE";
66
67 public static final String ANYTYPE_DELETE = "ANYTYPE_DELETE";
68
69 public static final String RELATIONSHIPTYPE_LIST = "RELATIONSHIPTYPE_LIST";
70
71 public static final String RELATIONSHIPTYPE_CREATE = "RELATIONSHIPTYPE_CREATE";
72
73 public static final String RELATIONSHIPTYPE_READ = "RELATIONSHIPTYPE_READ";
74
75 public static final String RELATIONSHIPTYPE_UPDATE = "RELATIONSHIPTYPE_UPDATE";
76
77 public static final String RELATIONSHIPTYPE_DELETE = "RELATIONSHIPTYPE_DELETE";
78
79 public static final String ROLE_LIST = "ROLE_LIST";
80
81 public static final String ROLE_CREATE = "ROLE_CREATE";
82
83 public static final String ROLE_READ = "ROLE_READ";
84
85 public static final String ROLE_UPDATE = "ROLE_UPDATE";
86
87 public static final String ROLE_DELETE = "ROLE_DELETE";
88
89 public static final String SCHEMA_LIST = "SCHEMA_LIST";
90
91 public static final String SCHEMA_CREATE = "SCHEMA_CREATE";
92
93 public static final String SCHEMA_READ = "SCHEMA_READ";
94
95 public static final String SCHEMA_UPDATE = "SCHEMA_UPDATE";
96
97 public static final String SCHEMA_DELETE = "SCHEMA_DELETE";
98
99 public static final String USER_SEARCH = "USER_SEARCH";
100
101 public static final String USER_LIST = "USER_LIST";
102
103 public static final String USER_CREATE = "USER_CREATE";
104
105 public static final String USER_READ = "USER_READ";
106
107 public static final String USER_UPDATE = "USER_UPDATE";
108
109 public static final String USER_DELETE = "USER_DELETE";
110
111 public static final String GROUP_SEARCH = "GROUP_SEARCH";
112
113 public static final String GROUP_CREATE = "GROUP_CREATE";
114
115 public static final String GROUP_READ = "GROUP_READ";
116
117 public static final String GROUP_UPDATE = "GROUP_UPDATE";
118
119 public static final String GROUP_DELETE = "GROUP_DELETE";
120
121 public static final String ANY_OBJECT_SEARCH = "ANY_OBJECT_SEARCH";
122
123 public static final String ANY_OBJECT_LIST = "ANY_OBJECT_LIST";
124
125 public static final String ANY_OBJECT_CREATE = "ANY_OBJECT_CREATE";
126
127 public static final String ANY_OBJECT_READ = "ANY_OBJECT_READ";
128
129 public static final String ANY_OBJECT_UPDATE = "ANY_OBJECT_UPDATE";
130
131 public static final String ANY_OBJECT_DELETE = "ANY_OBJECT_DELETE";
132
133 public static final String RESOURCE_LIST = "RESOURCE_LIST";
134
135 public static final String RESOURCE_CREATE = "RESOURCE_CREATE";
136
137 public static final String RESOURCE_READ = "RESOURCE_READ";
138
139 public static final String RESOURCE_UPDATE = "RESOURCE_UPDATE";
140
141 public static final String RESOURCE_DELETE = "RESOURCE_DELETE";
142
143 public static final String RESOURCE_GET_CONNOBJECT = "RESOURCE_GET_CONNOBJECT";
144
145 public static final String RESOURCE_LIST_CONNOBJECT = "RESOURCE_LIST_CONNOBJECT";
146
147 public static final String CONNECTOR_LIST = "CONNECTOR_LIST";
148
149 public static final String CONNECTOR_CREATE = "CONNECTOR_CREATE";
150
151 public static final String CONNECTOR_READ = "CONNECTOR_READ";
152
153 public static final String CONNECTOR_UPDATE = "CONNECTOR_UPDATE";
154
155 public static final String CONNECTOR_DELETE = "CONNECTOR_DELETE";
156
157 public static final String CONNECTOR_RELOAD = "CONNECTOR_RELOAD";
158
159 public static final String CONFIGURATION_EXPORT = "CONFIGURATION_EXPORT";
160
161 public static final String CONFIGURATION_LIST = "CONFIGURATION_LIST";
162
163 public static final String CONFIGURATION_SET = "CONFIGURATION_SET";
164
165 public static final String CONFIGURATION_DELETE = "CONFIGURATION_DELETE";
166
167 public static final String TASK_LIST = "TASK_LIST";
168
169 public static final String TASK_CREATE = "TASK_CREATE";
170
171 public static final String TASK_READ = "TASK_READ";
172
173 public static final String TASK_UPDATE = "TASK_UPDATE";
174
175 public static final String TASK_DELETE = "TASK_DELETE";
176
177 public static final String TASK_EXECUTE = "TASK_EXECUTE";
178
179 public static final String POLICY_LIST = "POLICY_LIST";
180
181 public static final String POLICY_CREATE = "POLICY_CREATE";
182
183 public static final String POLICY_READ = "POLICY_READ";
184
185 public static final String POLICY_UPDATE = "POLICY_UPDATE";
186
187 public static final String POLICY_DELETE = "POLICY_DELETE";
188
189 public static final String WORKFLOW_DEF_READ = "WORKFLOW_DEF_READ";
190
191 public static final String WORKFLOW_DEF_UPDATE = "WORKFLOW_DEF_UPDATE";
192
193 public static final String WORKFLOW_TASK_LIST = "WORKFLOW_TASK_LIST";
194
195 public static final String WORKFLOW_FORM_LIST = "WORKFLOW_FORM_LIST";
196
197 public static final String WORKFLOW_FORM_READ = "WORKFLOW_FORM_READ";
198
199 public static final String WORKFLOW_FORM_CLAIM = "WORKFLOW_FORM_CLAIM";
200
201 public static final String WORKFLOW_FORM_SUBMIT = "WORKFLOW_FORM_SUBMIT";
202
203 public static final String NOTIFICATION_LIST = "NOTIFICATION_LIST";
204
205 public static final String NOTIFICATION_CREATE = "NOTIFICATION_CREATE";
206
207 public static final String NOTIFICATION_READ = "NOTIFICATION_READ";
208
209 public static final String NOTIFICATION_UPDATE = "NOTIFICATION_UPDATE";
210
211 public static final String NOTIFICATION_DELETE = "NOTIFICATION_DELETE";
212
213 public static final String REPORT_LIST = "REPORT_LIST";
214
215 public static final String REPORT_READ = "REPORT_READ";
216
217 public static final String REPORT_CREATE = "REPORT_CREATE";
218
219 public static final String REPORT_UPDATE = "REPORT_UPDATE";
220
221 public static final String REPORT_DELETE = "REPORT_DELETE";
222
223 public static final String REPORT_EXECUTE = "REPORT_EXECUTE";
224
225 public static final String LOG_LIST = "LOG_LIST";
226
227 public static final String LOG_SET_LEVEL = "LOG_SET_LEVEL";
228
229 public static final String LOG_DELETE = "LOG_DELETE";
230
231 public static final String AUDIT_LIST = "AUDIT_LIST";
232
233 public static final String AUDIT_ENABLE = "AUDIT_ENABLE";
234
235 public static final String AUDIT_DISABLE = "AUDIT_DISABLE";
236
237 public static final String SECURITY_QUESTION_CREATE = "SECURITY_QUESTION_CREATE";
238
239 public static final String SECURITY_QUESTION_UPDATE = "SECURITY_QUESTION_UPDATE";
240
241 public static final String SECURITY_QUESTION_DELETE = "SECURITY_QUESTION_DELETE";
242
243 public static final String ROUTE_READ = "ROUTE_READ";
244
245 public static final String ROUTE_LIST = "ROUTE_LIST";
246
247 public static final String ROUTE_UPDATE = "ROUTE_UPDATE";
248
249 private static final Set<String> ENTITLEMENTS;
250
251 static {
252 Set<String> values = new HashSet<>();
253 for (Field field : Entitlement.class.getDeclaredFields()) {
254 if (Modifier.isStatic(field.getModifiers()) && String.class.equals(field.getType())) {
255 values.add(field.getName());
256 }
257 }
258 values.remove(ANONYMOUS);
259 values.remove(MUST_CHANGE_PASSWORD);
260 ENTITLEMENTS = Collections.unmodifiableSet(values);
261 }
262
263 public static Set<String> values() {
264 return ENTITLEMENTS;
265 }
266
267 private Entitlement() {
268 // private constructor for static utility class
269 }
270 }