Commit 762ddd37 authored by michael.simon's avatar michael.simon
Browse files

add/remove groups from roles via roleview

parent 8c4d3a18
......@@ -12,12 +12,10 @@ package edu.kit.scc.webreg.entity.as;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import edu.kit.scc.webreg.entity.GlobalGroupEntity;
@Entity(name = "AttributeSourceGroupEntity")
@Table(name = "attribute_src_group")
public class AttributeSourceGroupEntity extends GlobalGroupEntity {
private static final long serialVersionUID = 1L;
......
......@@ -41,4 +41,8 @@ public interface RoleService extends BaseService<RoleEntity, Long> {
List<GroupEntity> findGroupsForRole(RoleEntity role);
void addGroupToRole(GroupEntity group, RoleEntity role);
void removeGroupFromRole(GroupEntity group, RoleEntity role);
}
......@@ -41,6 +41,16 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleEntity, Long> implement
dao.deleteUserRole(user.getId(), roleName);
}
@Override
public void addGroupToRole(GroupEntity group, RoleEntity role) {
dao.addGroupToRole(group, role);
}
@Override
public void removeGroupFromRole(GroupEntity group, RoleEntity role) {
dao.removeGroupFromRole(group, role);
}
@Override
public List<RoleEntity> findByUser(UserEntity user) {
return dao.findByUser(user);
......
......@@ -69,7 +69,7 @@ public class ShowRoleBean implements Serializable {
}
public void removeGroupFromRole(GroupEntity group) {
//service.removeGroupFromRole(group, entity.getName());
service.removeGroupFromRole(group, entity);
groupList = service.findGroupsForRole(entity);
}
......@@ -79,7 +79,7 @@ public class ShowRoleBean implements Serializable {
}
public void addGroupToRole(GroupEntity group) {
//service.removeGroupFromRole(group, entity.getName());
service.addGroupToRole(group, entity);
groupList = service.findGroupsForRole(entity);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment