18 package org.turro.elephant.impl.security;
20 import java.util.List;
21 import java.util.TreeMap;
22 import org.jdom.Element;
23 import org.turro.actor.Actors;
33 String[] roles = role.split(
"\\s*\\|\\s*");
34 for(String r : roles) {
35 if(checkRole(r))
return true;
40 private boolean checkRole(String role) {
41 String[] value = role.split(
"\\s*:\\s*");
42 if(value.length == 2) {
43 if(
"@actor".equals(value[0])) {
45 }
else if(containsKey(value[0])) {
46 return get(value[0]).contains(value[1]);
53 for(Element el : children) {
54 RoleValue rv =
get(el.getAttributeValue(
"name"));
58 put(el.getAttributeValue(
"name"),
59 new RoleValue(el.getAttributeValue(
"value").split(
" *, *")));
67 for(Element el : children) {
68 ra.put(el.getAttributeValue(
"name"),
69 new RoleValue(el.getAttributeValue(
"value").split(
" *, *")));
static boolean isActor(String actor)
void addFromElementChildren(List< Element > children)
static RoleAttribute loadFromElementChildren(List< Element > children)
boolean isInRole(String role)
void loadFrom(RoleValue values)