Skip to content
Snippets Groups Projects
Unverified Commit ddc2f75f authored by Timm Fitschen's avatar Timm Fitschen
Browse files

BUG: in AccessControl

parent 631f79ef
No related branches found
No related tags found
No related merge requests found
...@@ -68,8 +68,10 @@ public class AccessControl extends ContainerJob { ...@@ -68,8 +68,10 @@ public class AccessControl extends ContainerJob {
if (par1.hasId() && par1.getId() > 0) { if (par1.hasId() && par1.getId() > 0) {
Database.execute(new RetrieveSparseEntity(par1), getTransaction().getAccess()); Database.execute(new RetrieveSparseEntity(par1), getTransaction().getAccess());
} }
if (par1.hasName() && par1.getName().equals("CommentAnnotation") && subject if (par1.hasName()
.isPermitted(getTransaction().getClass().getSimpleName() + ":CommentAnnotation")) { && par1.getName().equals("CommentAnnotation")
&& subject.isPermitted(
getTransaction().getClass().getSimpleName() + ":CommentAnnotation")) {
continue; continue;
} }
} }
......
...@@ -38,17 +38,16 @@ import caosdb.server.utils.mail.Mail; ...@@ -38,17 +38,16 @@ import caosdb.server.utils.mail.Mail;
"Value may be any mail address. Send a test mail to the given mail address. Works only if server is in debug mode.") "Value may be any mail address. Send a test mail to the given mail address. Works only if server is in debug mode.")
public class TestMail extends FlagJob { public class TestMail extends FlagJob {
private static final String ADMIN_NAME = private static final String NAME =
CaosDBServer.getServerProperty(ServerProperties.KEY_ADMIN_NAME); CaosDBServer.getServerProperty(ServerProperties.KEY_NO_REPLY_NAME);
private static final String ADMIN_EMAIL = private static final String EMAIL =
CaosDBServer.getServerProperty(ServerProperties.KEY_ADMIN_EMAIL); CaosDBServer.getServerProperty(ServerProperties.KEY_NO_REPLY_EMAIL);
@Override @Override
protected void job(final String value) { protected void job(final String value) {
if (CaosDBServer.isDebugMode() && value != null) { if (CaosDBServer.isDebugMode() && value != null) {
if (Utils.isRFC822Compliant(value)) { if (Utils.isRFC822Compliant(value)) {
final Mail m = final Mail m = new Mail(NAME, EMAIL, null, value, "Test mail", "This is a test mail.");
new Mail(ADMIN_NAME, ADMIN_EMAIL, null, value, "Test mail", "This is a test mail.");
m.send(); m.send();
getContainer() getContainer()
.addMessage(new Message(MessageType.Info, 0, "A mail has been send to " + value)); .addMessage(new Message(MessageType.Info, 0, "A mail has been send to " + value));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment