Skip to content
Snippets Groups Projects
Commit 3b3cd4db authored by Larbi Gharib's avatar Larbi Gharib
Browse files

Fix admin access

Change-Id: I6e7494da43c9da0ae4c7e16828ea23b783534961
parent 4046c28a
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,10 @@ public class User extends X509Entity implements BlockchainEntity, DatabaseObject
return ethKey;
}
public String getAccessLevelName() {
return this.accessLevel.name();
}
@Override
public void setKey(String key) {
this.ethKey = key;
......
......@@ -85,7 +85,7 @@ public class LoginServlet extends HttpServlet {
statementList.addStatement(statementElement);
User user = dataStore.getUserDao().getObjects(statementList).get(0);
if(certificateAuthority.getLatestCRL().get() != null) {
if(certificateAuthority.getLatestCRL().get().getRevokedCertificate(user.getCertificate().getSerialNumber()) != null)
if(!user.getAccessLevelName().equals("ADMIN") && certificateAuthority.getLatestCRL().get().getRevokedCertificate(user.getCertificate().getSerialNumber()) != null)
TomcatCustomErrorHandler.sendCustomError(resp, 401, "Invalid credentials provided!");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment