forked from blcham/record-manager
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[kbss-cvut/record-manager-ui#202] Implement Role group configuration …
…by model.ttl
- Loading branch information
Showing
16 changed files
with
212 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/cz/cvut/kbss/study/security/model/RoleGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package cz.cvut.kbss.study.security.model; | ||
|
||
import cz.cvut.kbss.study.model.Vocabulary; | ||
import cz.cvut.kbss.study.security.SecurityConstants; | ||
|
||
import java.util.Optional; | ||
import java.util.stream.Stream; | ||
|
||
public enum RoleGroup { | ||
|
||
|
||
OPERATOR_ADMIN(SecurityConstants.ROLE_GROUP_OPERATOR_ADMIN, Vocabulary.s_i_operator_admin_role_group), | ||
OPERATOR(SecurityConstants.ROLE_GROUP_OPERATOR, Vocabulary.s_i_operator_role_group), | ||
SUPPLIER_ADMIN(SecurityConstants.ROLE_GROUP_SUPPLIER_ADMIN, Vocabulary.s_i_supplier_admin_role_group), | ||
SUPPLIER(SecurityConstants.ROLE_GROUP_SUPPLIER, Vocabulary.s_i_supplier_role_group), | ||
EXTERNAL_USER(SecurityConstants.ROLE_GROUP_EXTERNAL_USER, Vocabulary.s_i_external_user_role_group); | ||
|
||
|
||
private final String name; | ||
private final String type; | ||
|
||
RoleGroup(String name, String type) { | ||
this.name = name; | ||
this.type = type; | ||
} | ||
|
||
public static Optional<RoleGroup> forType(String type) { | ||
return Stream.of(RoleGroup.values()).filter(r -> r.type.equals(type)).findAny(); | ||
} | ||
|
||
public static Optional<RoleGroup> forName(String name) { | ||
return Stream.of(RoleGroup.values()).filter(r -> r.name.equals(name)).findAny(); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 0 additions & 78 deletions
78
src/main/java/cz/cvut/kbss/study/util/RoleAssignmentUtil.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.