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

insert logging statement

parent a7d997a6
......@@ -21,6 +21,8 @@ import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.slf4j.Logger;
import edu.kit.scc.webreg.bootstrap.ApplicationConfig;
import edu.kit.scc.webreg.entity.AdminRoleEntity;
import edu.kit.scc.webreg.entity.ApproverRoleEntity;
......@@ -53,6 +55,9 @@ public class AuthorizationBean implements Serializable {
private List<ServiceEntity> serviceHotlineList;
private List<ServiceEntity> serviceGroupAdminList;
@Inject
private Logger logger;
@Inject
private RegistryService registryService;
......@@ -82,10 +87,19 @@ public class AuthorizationBean implements Serializable {
if (sessionManager.getUserId() == null)
return;
long start, end;
UserEntity user = userService.findByIdWithStore(sessionManager.getUserId());
List<GroupEntity> groupList = groupService.findByUser(user);
String groupString = groupsToString(groupList);
List<ServiceEntity> unregisteredServiceList;
List<RegistryEntity> userRegistryList;
List<ServiceEntity> serviceApproverList;
List<ServiceEntity> serviceAdminList;
List<ServiceEntity> serviceHotlineList;
List<ServiceEntity> serviceGroupAdminList;
userRegistryList = registryService.findByUserAndNotStatus(user, RegistryStatus.DELETED, RegistryStatus.DEPROVISIONED);
serviceApproverList = new ArrayList<ServiceEntity>();
......@@ -127,6 +141,8 @@ public class AuthorizationBean implements Serializable {
}
unregisteredServiceList.removeAll(serviceToRemove);
start = System.currentTimeMillis();
List<RoleEntity> roleList = roleService.findByUser(user);
for (RoleEntity role : roleList) {
......@@ -142,6 +158,8 @@ public class AuthorizationBean implements Serializable {
serviceGroupAdminList.addAll(serviceService.findByGroupAdminRole(role));
}
}
end = System.currentTimeMillis();
logger.debug("Role loading took {} ms", (end-start));
}
public boolean isUserInRole(String roleName) {
......
......@@ -39,6 +39,7 @@ public class SessionManager implements Serializable {
private String originalIdpEntityId;
private Set<Long> roles;
private Long roleSetCreated;
private String theme;
......@@ -138,5 +139,14 @@ public class SessionManager implements Serializable {
public void setOriginalRequestPath(String originalRequestPath) {
this.originalRequestPath = originalRequestPath;
}
}
public Long getRoleSetCreated() {
return roleSetCreated;
}
public void setRoleSetCreated(Long roleSetCreated) {
this.roleSetCreated = roleSetCreated;
}
}
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