Commit 0720f073 by Tuukka Kivilahti

do not conflig, fo not conflig...

1 parent f51d8f3e
...@@ -46,6 +46,9 @@ public class RoleBean implements RoleBeanLocal { ...@@ -46,6 +46,9 @@ public class RoleBean implements RoleBeanLocal {
public List<Role> getPossibleParents(Role role) { public List<Role> getPossibleParents(Role role) {
List<Role> roleList = listRoles(); List<Role> roleList = listRoles();
if(role == null)
return roleList;
List<Role> children = getAllChilds(role, new HashSet<Role>()); List<Role> children = getAllChilds(role, new HashSet<Role>());
for (Role unit : children) { for (Role unit : children) {
...@@ -63,7 +66,7 @@ public class RoleBean implements RoleBeanLocal { ...@@ -63,7 +66,7 @@ public class RoleBean implements RoleBeanLocal {
List<Role> returnList = new ArrayList<Role>(); List<Role> returnList = new ArrayList<Role>();
if (checkedRoles.contains(role)) { if (checkedRoles.contains(role) || role == null) {
return returnList; return returnList;
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*/ */
package fi.insomnia.bortal.model; package fi.insomnia.bortal.model;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
...@@ -47,10 +48,10 @@ public class Role implements EventChildInterface { ...@@ -47,10 +48,10 @@ public class Role implements EventChildInterface {
@JoinColumns({ @JoinColumns({
@JoinColumn(name = "role_id", referencedColumnName = "entity_id", nullable = false, updatable = false, insertable = false), @JoinColumn(name = "role_id", referencedColumnName = "entity_id", nullable = false, updatable = false, insertable = false),
@JoinColumn(name = "role_event_id", referencedColumnName = "events_pk_id", nullable = false, updatable = false, insertable = false) }) @JoinColumn(name = "role_event_id", referencedColumnName = "events_pk_id", nullable = false, updatable = false, insertable = false) })
private List<Role> children; private List<Role> children = new ArrayList<Role>();
@ManyToMany(mappedBy = "children") @ManyToMany(mappedBy = "children")
private List<Role> parents; private List<Role> parents = new ArrayList<Role>();
@OneToMany(cascade = CascadeType.ALL, mappedBy = "role") @OneToMany(cascade = CascadeType.ALL, mappedBy = "role")
private List<RoleRight> roleRights; private List<RoleRight> roleRights;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<ui:composition template="/layout/default-template.xhtml"> <ui:composition template="/layout/default-template.xhtml">
<ui:define name="title">listRoles</ui:define> <ui:define name="title">listRoles</ui:define>
<ui:define name="header">List roles</ui:define> <ui:define name="header">List "roles</ui:define>
<ui:define name="content"> <ui:define name="content">
<role:list /> <role:list />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!