BrightSide Workbench Full Report + Source Code
org.turro.elephant.impl.security.ProfileMap Class Reference
Inheritance diagram for org.turro.elephant.impl.security.ProfileMap:
Collaboration diagram for org.turro.elephant.impl.security.ProfileMap:

Public Member Functions

boolean isInRoleByProfile (String profile, String role)
 
List< String > getProfilesInRole (String role)
 

Static Public Member Functions

static void resetProfiles ()
 
static ProfileMap loadProfiles () throws IOException
 
static List loadRoleByExpression (String expression) throws IOException
 
static List loadRoleFile (File confFile, String expression) throws IOException
 
static List getRoleNames () throws IOException
 
static List getRoleNamesByFilter (String filter) throws IOException
 

Static Public Attributes

static final String ROLES_CONFIGURATION = "/WEB-INF/elephant/conf/xproles.xml"
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g Role = {role1 = [value1, value2, ...], role2 = [...], ...}

Definition at line 43 of file ProfileMap.java.

Member Function Documentation

◆ getProfilesInRole()

List<String> org.turro.elephant.impl.security.ProfileMap.getProfilesInRole ( String  role)

Definition at line 54 of file ProfileMap.java.

54  {
55  List<String> profiles = new ArrayList<String>();
56  for(String s : keySet()) {
57  if(role == null) {
58  profiles.add(s);
59  }
60  else if(get(s).isInRole(role)) {
61  profiles.add(s);
62  }
63  }
64  return profiles;
65  }
Here is the caller graph for this function:

◆ getRoleNames()

static List org.turro.elephant.impl.security.ProfileMap.getRoleNames ( ) throws IOException
static

Definition at line 135 of file ProfileMap.java.

135  {
136  List<String> names = new ArrayList<String>();
137  for(Attribute a : (List<Attribute>) loadRoleByExpression("/xproles/role/@name")) {
138  names.add(a.getValue());
139  }
140  return names;
141  }
static List loadRoleByExpression(String expression)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRoleNamesByFilter()

static List org.turro.elephant.impl.security.ProfileMap.getRoleNamesByFilter ( String  filter) throws IOException
static

Definition at line 143 of file ProfileMap.java.

143  {
144  List<String> names = new ArrayList<String>();
145  for(Attribute a : (List<Attribute>) loadRoleByExpression("/xproles/role[resource/@name='" + filter + "']/@name")) {
146  names.add(a.getValue());
147  }
148  return names;
149  }
Here is the call graph for this function:

◆ isInRoleByProfile()

boolean org.turro.elephant.impl.security.ProfileMap.isInRoleByProfile ( String  profile,
String  role 
)

Definition at line 45 of file ProfileMap.java.

45  {
46  if(profile != null) {
47  if(containsKey(profile)) {
48  return get(profile).isInRole(role);
49  }
50  }
51  return false;
52  }
Here is the caller graph for this function:

◆ loadProfiles()

static ProfileMap org.turro.elephant.impl.security.ProfileMap.loadProfiles ( ) throws IOException
static

Definition at line 78 of file ProfileMap.java.

78  {
79  if(fullMap == null) {
80  lock.lock();
81  try {
82  if(fullMap == null) {
83  fullMap = loadFromElementsList(loadRoleByExpression("/xproles/role"));
84  }
85  } finally {
86  lock.unlock();
87  }
88  }
89  return fullMap;
90  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadRoleByExpression()

static List org.turro.elephant.impl.security.ProfileMap.loadRoleByExpression ( String  expression) throws IOException
static

Definition at line 107 of file ProfileMap.java.

107  {
108  List roles = new ArrayList();
109  List l = loadRoleFile(
110  new File(ElephantContext.getRealPath(ROLES_CONFIGURATION)),
111  expression);
112  if(l != null) roles.addAll(l);
113  l = loadRoleFile(
114  new File(ElephantContext.getRealPath(ROLES_SITE_CONFIGURATION)),
115  expression);
116  if(l != null) roles.addAll(l);
117  return roles;
118  }
static List loadRoleFile(File confFile, String expression)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadRoleFile()

static List org.turro.elephant.impl.security.ProfileMap.loadRoleFile ( File  confFile,
String  expression 
) throws IOException
static

Definition at line 120 of file ProfileMap.java.

120  {
121  if (confFile.exists()) {
122  SAXBuilder builder = new SAXBuilder();
123  try {
124  Document doc = builder.build(confFile);
125  return XPath.selectNodes(doc, expression);
126  } catch (IOException ex) {
127  Logger.getLogger(ProfileMap.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
128  } catch (JDOMException ex) {
129  Logger.getLogger(XpUser.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
130  }
131  }
132  return null;
133  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetProfiles()

static void org.turro.elephant.impl.security.ProfileMap.resetProfiles ( )
static

Definition at line 74 of file ProfileMap.java.

74  {
75  fullMap = null;
76  }
Here is the caller graph for this function:

Member Data Documentation

◆ ROLES_CONFIGURATION

final String org.turro.elephant.impl.security.ProfileMap.ROLES_CONFIGURATION = "/WEB-INF/elephant/conf/xproles.xml"
static

Definition at line 68 of file ProfileMap.java.


The documentation for this class was generated from the following file: