Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 69d1e731
authored
Jun 11, 2010
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.intra.insomnia.fi:/data/bortal
2 parents
12fbbb8b
b35272de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
5 deletions
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/enums/Role.java
code/LanBortalWeb/WebContent/index.xhtml
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/enums/Role.java
View file @
69d1e73
package
fi
.
insomnia
.
bortal
.
enums
;
package
fi
.
insomnia
.
bortal
.
enums
;
import
java.util.HashSet
;
import
java.util.Set
;
public
enum
Role
{
public
enum
Role
{
USER_BASE
(
true
),
// Logged in user
ADMIN_BASE
(
true
),
// Bean level access
SUPERADMIN
(
false
)
// Admin for this event
ANONYMOUS
,
// Unauthenticated web user
USER_BASE
,
// JAAS access for logged in user
ADMIN_BASE
(
USER_BASE
),
// JAAS access to administrative beans
// Admin for the whole system (JAAS, boolean in User)
SUPERADMIN
(
false
,
ADMIN_BASE
),
ORGANIZATION_ROOT
(
ADMIN_BASE
),
// E.g. Vectorama organisation admin
;
;
private
boolean
inDatabase
;
private
boolean
inDatabase
;
private
Set
<
Role
>
parents
=
new
HashSet
<
Role
>();
Role
()
{
}
/**
* Default (on-demand create time) parents for the role
*
* @param parent
*/
Role
(
Role
...
parent
)
{
for
(
Role
role
:
parent
)
{
parents
.
add
(
role
);
}
}
Role
(
boolean
inDb
)
{
/**
inDatabase
=
inDb
;
* Is the role stored in the database (default true) or is it a magic role
* like superadmin (stored as boolean in User).
*
* @param inDb
* stored in roles-table
* @param parent
* default (create time) parent roles
*/
Role
(
boolean
inDb
,
Role
...
parent
)
{
this
(
parent
);
this
.
inDatabase
=
inDb
;
}
}
public
boolean
isInDatabase
()
{
public
boolean
isInDatabase
()
{
return
inDatabase
;
return
inDatabase
;
}
}
/**
* Default parent roles (when creating role on first use)
*
* @return
*/
public
Set
<
Role
>
getParents
()
{
return
parents
;
}
}
}
code/LanBortalWeb/WebContent/index.xhtml
View file @
69d1e73
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
<ul>
<ul>
<li><h:commandLink
action=
"generateTestData"
>
Generate test data
</h:commandLink></li>
<li><h:commandLink
action=
"generateTestData"
>
Generate test data
</h:commandLink></li>
<li><h:commandLink
action=
"user/list"
>
List users
</h:commandLink></li>
<li><h:commandLink
action=
"user/list"
>
List users
</h:commandLink></li>
<li><h:commandLink
action=
"user/create"
>
Create user
</h:commandLink></li>
<li><h:commandLink
action=
"tests/placemap"
>
Placemap test
</h:commandLink></li>
<li><h:commandLink
action=
"PlaceMap?mapid=1"
>
Show map 1
</h:commandLink></li>
</ul>
</ul>
</h:form>
</h:form>
</ui:define>
</ui:define>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment