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

Public Member Functions

 AbstractUser ()
 
boolean isInRole (String role)
 
boolean hasAnyRoleKey (String role)
 
void setConstructor (IConstructor constructor)
 
- Public Member Functions inherited from org.turro.elephant.security.IUser
boolean validate (String login, String password)
 
boolean validate (String key)
 
boolean validate2 (String password2)
 
boolean impersonate (String login)
 
boolean impersonateByEmail (String email)
 
boolean isValid ()
 
void reload ()
 
boolean isThisUser (String id)
 
String getId ()
 
String getName ()
 
String getProperty (String key)
 
boolean equals (Object obj)
 
Map getByDescriptors (String value)
 
boolean hasRoleName (String role)
 
List getUsers ()
 
String createTmpKey (Date valid)
 

Protected Attributes

String name
 
IConstructor constructor
 
boolean superUser = false
 
UserProfileMap upm
 

Additional Inherited Members

- Static Public Attributes inherited from org.turro.elephant.security.IUser
static final String CONNECTOR_EMAIL = "Email"
 
static final String CONNECTOR_TRADE = "TradeName"
 
static final String CONNECTOR_FISCAL = "FiscalName"
 
static final String CONNECTOR_EMAIL_LOGIN = "EmailLogin"
 
static final String ADDRESS_FISCAL = "Fiscal"
 
static final String LOGGED_USER = "xp_user"
 
static final String INTERNAL_SIGNIN = "InternalSignIn"
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 27 of file AbstractUser.java.

Constructor & Destructor Documentation

◆ AbstractUser()

org.turro.elephant.impl.security.AbstractUser.AbstractUser ( )

Creates a new instance of AbstractUser

Definition at line 35 of file AbstractUser.java.

35  {
36  }

Member Function Documentation

◆ hasAnyRoleKey()

boolean org.turro.elephant.impl.security.AbstractUser.hasAnyRoleKey ( String  role)

Implements org.turro.elephant.security.IUser.

Definition at line 45 of file AbstractUser.java.

45  {
46  if(superUser) return true;
47  String[] value = role.split(" *, *");
48  for(String s : value) {
49  if(upm.containsKey(s)) {
50  return true;
51  }
52  }
53  return false;
54  }

◆ isInRole()

boolean org.turro.elephant.impl.security.AbstractUser.isInRole ( String  role)

Usually this method should take this form:

 if(user.isInRole("page:edit")) {
   // edit page
 }
Parameters
roleRole to check.
Returns
True if user is in role.

Implements org.turro.elephant.security.IUser.

Definition at line 39 of file AbstractUser.java.

39  {
40  if(superUser) return true;
41  return upm.isInRole(role);
42  }
Here is the call graph for this function:

◆ setConstructor()

void org.turro.elephant.impl.security.AbstractUser.setConstructor ( IConstructor  constructor)

Implements org.turro.elephant.security.IUser.

Definition at line 57 of file AbstractUser.java.

57  {
58  this.constructor = constructor;
59  }

Member Data Documentation

◆ constructor

IConstructor org.turro.elephant.impl.security.AbstractUser.constructor
protected

Definition at line 30 of file AbstractUser.java.

◆ name

String org.turro.elephant.impl.security.AbstractUser.name
protected

Definition at line 29 of file AbstractUser.java.

◆ superUser

boolean org.turro.elephant.impl.security.AbstractUser.superUser = false
protected

Definition at line 31 of file AbstractUser.java.

◆ upm

UserProfileMap org.turro.elephant.impl.security.AbstractUser.upm
protected

Definition at line 32 of file AbstractUser.java.


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