Commit fddc0921 authored by michael.simon's avatar michael.simon
Browse files

Remove service project admin structure

parent ea7577b4
......@@ -42,8 +42,6 @@ public interface ServiceDao extends BaseDao<ServiceEntity, Long> {
List<ServiceEntity> findByParentService(ServiceEntity service);
List<ServiceEntity> findByProjectAdminRole(RoleEntity role);
List<ServiceEntity> findBySshPubKeyApproverRole(RoleEntity role);
}
......@@ -95,13 +95,6 @@ public class JpaServiceDao extends JpaBaseDao<ServiceEntity, Long> implements Se
.setParameter("role", role).getResultList();
}
@Override
@SuppressWarnings({"unchecked"})
public List<ServiceEntity> findByProjectAdminRole(RoleEntity role) {
return em.createQuery("select e from ServiceEntity e where e.projectAdminRole = :role")
.setParameter("role", role).getResultList();
}
@Override
@SuppressWarnings({"unchecked"})
public List<ServiceEntity> findByGroupCapability(Boolean capable) {
......
......@@ -43,6 +43,4 @@ public interface ServiceService extends BaseService<ServiceEntity, Long> {
List<ServiceEntity> findByParentService(ServiceEntity service);
List<ServiceEntity> findBySshPubKeyApproverRole(RoleEntity role);
List<ServiceEntity> findByProjectAdminRole(RoleEntity role);
}
......@@ -94,11 +94,6 @@ public class ServiceServiceImpl extends BaseServiceImpl<ServiceEntity, Long> imp
return dao.findByGroupAdminRole(role);
}
@Override
public List<ServiceEntity> findByProjectAdminRole(RoleEntity role) {
return dao.findByProjectAdminRole(role);
}
@Override
public List<ServiceEntity> findAllWithPolicies() {
return dao.findAllWithPolicies();
......
......@@ -56,7 +56,6 @@ public class SessionManager implements Serializable {
private List<ServiceEntity> serviceAdminList;
private List<ServiceEntity> serviceHotlineList;
private List<ServiceEntity> serviceGroupAdminList;
private List<ServiceEntity> serviceProjectAdminList;
private List<ServiceEntity> unregisteredServiceList;
private Long unregisteredServiceCreated;
......@@ -79,7 +78,6 @@ public class SessionManager implements Serializable {
serviceAdminList = new ArrayList<ServiceEntity>();
serviceHotlineList = new ArrayList<ServiceEntity>();
serviceGroupAdminList = new ArrayList<ServiceEntity>();
serviceProjectAdminList = new ArrayList<ServiceEntity>();
groups = new HashSet<GroupEntity>();
groupNames = new HashSet<String>();
roles = new HashSet<RoleEntity>();
......@@ -268,10 +266,6 @@ public class SessionManager implements Serializable {
this.authnRequestIdpConfigId = authnRequestIdpConfigId;
}
public List<ServiceEntity> getServiceProjectAdminList() {
return serviceProjectAdminList;
}
public List<ServiceEntity> getServiceSshPubKeyApproverList() {
return serviceSshPubKeyApproverList;
}
......
......@@ -51,8 +51,6 @@ public class ProjectAdminListProjectBean implements Serializable {
serviceEntity = serviceService.findById(serviceId);
}
if (! authBean.isUserServiceProjectAdmin(serviceEntity))
throw new NotAuthorizedException("Nicht autorisiert");
}
public List<ProjectEntity> getProjectList() {
......
......@@ -39,7 +39,6 @@ import edu.kit.scc.webreg.entity.SamlUserEntity;
import edu.kit.scc.webreg.entity.ServiceEntity;
import edu.kit.scc.webreg.entity.SshPubKeyApproverRoleEntity;
import edu.kit.scc.webreg.entity.UserEntity;
import edu.kit.scc.webreg.entity.project.ProjectAdminRoleEntity;
import edu.kit.scc.webreg.service.GroupService;
import edu.kit.scc.webreg.service.RegistryService;
import edu.kit.scc.webreg.service.RoleService;
......@@ -162,10 +161,6 @@ public class AuthorizationBean implements Serializable {
for (ServiceEntity s : serviceService.findByGroupAdminRole(role))
sessionManager.getServiceGroupAdminList().add(s);
}
else if (role instanceof ProjectAdminRoleEntity) {
for (ServiceEntity s : serviceService.findByProjectAdminRole(role))
sessionManager.getServiceProjectAdminList().add(s);
}
}
end = System.currentTimeMillis();
logger.trace("Role loading took {} ms", (end-start));
......@@ -337,12 +332,6 @@ public class AuthorizationBean implements Serializable {
return sessionManager.getServiceGroupAdminList().contains(id);
}
public boolean isUserServiceProjectAdmin(ServiceEntity id) {
if (id == null)
return false;
return sessionManager.getServiceProjectAdminList().contains(id);
}
public List<RegistryEntity> getUserRegistryList() {
if (userRegistryList == null) init();
return userRegistryList;
......@@ -368,10 +357,6 @@ public class AuthorizationBean implements Serializable {
return sessionManager.getServiceGroupAdminList();
}
public List<ServiceEntity> getServiceProjectAdminList() {
return sessionManager.getServiceProjectAdminList();
}
public boolean isPasswordCapable(ServiceEntity serviceEntity) {
if (serviceEntity.getPasswordCapable() != null)
return serviceEntity.getPasswordCapable();
......
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