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 e01439e0
authored
May 13, 2012
by
Juho Salli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.insomnia.fi:/data/bortal
2 parents
64ced6ee
a49cf635
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
14 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PermissionBean.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/OrgRole.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PermissionBean.java
View file @
e01439e
...
...
@@ -98,10 +98,13 @@ public class PermissionBean implements PermissionBeanLocal {
@EJB
private
UserFacade
userfacade
;
@EJB
private
EventUserFacade
eventUserFacade
;
@EJB
private
EventBeanLocal
eventbean
;
//
// @Override
// public boolean hasPermission(String perm) {
...
...
@@ -180,15 +183,17 @@ public class PermissionBean implements PermissionBeanLocal {
public
EventUser
getAnonEventUser
()
{
EventUser
defaultUser
=
eventUserFacade
.
findByLogin
(
User
.
ANONYMOUS_LOGINNAME
);
if
(
defaultUser
==
null
)
{
defaultUser
=
new
EventUser
();
defaultUser
=
new
EventUser
(
new
User
(),
eventbean
.
getCurrentEvent
());
defaultUser
.
setLogin
(
User
.
ANONYMOUS_LOGINNAME
);
defaultUser
.
setNick
(
User
.
ANONYMOUS_LOGINNAME
);
eventUserFacade
.
create
(
defaultUser
);
eventUserFacade
.
flush
();
}
return
defaultUser
;
}
public
String
getPrincipal
()
{
Principal
principal
=
context
.
getCallerPrincipal
();
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/OrgRole.java
View file @
e01439e
...
...
@@ -51,7 +51,7 @@ public class OrgRole extends GenericEntity {
@ManyToOne
()
private
EventOrganiser
eventOrganizer
;
@
OneToMany
@
ManyToMany
(
mappedBy
=
"orgRoles"
)
private
List
<
Role
>
eventRoles
;
public
OrgRole
()
{
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
View file @
e01439e
...
...
@@ -31,7 +31,7 @@ public class Role extends GenericEntity {
protected
static
final
String
NAME_COLUMN
=
"role_name"
;
protected
static
final
String
EVENT_ID_COLUMN
=
"event_id"
;
protected
static
final
String
ORG_ROLE_ID_COLUMN
=
"org_role_id"
;
public
static
final
Role
EMPTY_ROLE
=
new
Role
(
"----"
);
...
...
@@ -76,10 +76,12 @@ public class Role extends GenericEntity {
@ManyToOne
@JoinColumn
(
name
=
EVENT_ID_COLUMN
,
nullable
=
false
)
private
LanEvent
event
;
@ManyToOne
@JoinColumn
(
name
=
ORG_ROLE_ID_COLUMN
)
private
OrgRole
orgRole
;
@ManyToMany
@JoinTable
(
name
=
"roles_provided_by_org_roles"
,
joinColumns
=
{
@JoinColumn
(
name
=
"role_id"
,
referencedColumnName
=
Role
.
ID_COLUMN
)
},
inverseJoinColumns
=
{
@JoinColumn
(
name
=
"org_role_id"
,
referencedColumnName
=
OrgRole
.
ID_COLUMN
)
})
private
List
<
OrgRole
>
orgRoles
;
public
Role
()
{
super
();
...
...
@@ -196,12 +198,12 @@ public class Role extends GenericEntity {
this
.
users
=
users
;
}
public
OrgRole
getOrgRole
()
{
return
orgRole
;
public
List
<
OrgRole
>
getOrgRoles
()
{
return
orgRole
s
;
}
public
void
setOrgRole
(
OrgRole
orgRole
)
{
this
.
orgRole
=
orgRole
;
public
void
setOrgRole
s
(
List
<
OrgRole
>
orgRoles
)
{
this
.
orgRole
s
=
orgRoles
;
}
}
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