BrightSide Workbench Full Report + Source Code
AbstractUser.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
package
org.turro.elephant.impl.security;
19
20
import
org.turro.elephant.context.IConstructor;
21
import
org.turro.elephant.security.IUser;
22
27
abstract
public
class
AbstractUser
implements
IUser
{
28
29
protected
String
name
;
30
protected
IConstructor
constructor
;
31
protected
boolean
superUser
=
false
;
32
protected
UserProfileMap
upm
;
33
35
public
AbstractUser
() {
36
}
37
38
@Override
39
public
boolean
isInRole
(String role) {
40
if
(
superUser
)
return
true
;
41
return
upm
.
isInRole
(role);
42
}
43
44
@Override
45
public
boolean
hasAnyRoleKey
(String role) {
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
}
55
56
@Override
57
public
void
setConstructor
(
IConstructor
constructor
) {
58
this.constructor =
constructor
;
59
}
60
61
}
org.turro.elephant.impl.security.AbstractUser
Definition:
AbstractUser.java:27
org.turro.elephant.impl.security.AbstractUser.superUser
boolean superUser
Definition:
AbstractUser.java:31
org.turro.elephant.impl.security.AbstractUser.name
String name
Definition:
AbstractUser.java:29
org.turro.elephant.impl.security.AbstractUser.isInRole
boolean isInRole(String role)
Definition:
AbstractUser.java:39
org.turro.elephant.impl.security.AbstractUser.upm
UserProfileMap upm
Definition:
AbstractUser.java:32
org.turro.elephant.impl.security.AbstractUser.hasAnyRoleKey
boolean hasAnyRoleKey(String role)
Definition:
AbstractUser.java:45
org.turro.elephant.impl.security.AbstractUser.AbstractUser
AbstractUser()
Definition:
AbstractUser.java:35
org.turro.elephant.impl.security.AbstractUser.constructor
IConstructor constructor
Definition:
AbstractUser.java:30
org.turro.elephant.impl.security.AbstractUser.setConstructor
void setConstructor(IConstructor constructor)
Definition:
AbstractUser.java:57
org.turro.elephant.impl.security.RoleAttribute.isInRole
boolean isInRole(String role)
Definition:
RoleAttribute.java:32
org.turro.elephant.impl.security.UserProfileMap
Definition:
UserProfileMap.java:36
org.turro.elephant.context.IConstructor
Definition:
IConstructor.java:41
org.turro.elephant.security.IUser
Definition:
IUser.java:30
TurroProjects
Public
Elephant
elephant
src
main
java
org
turro
elephant
impl
security
AbstractUser.java
Generated on Sun May 8 2022 11:23:25 for BrightSide by
1.9.1