Skip to content
Snippets Groups Projects
Verified Commit 943593f6 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

FIX: scripting purpose

parent 218584dc
Branches
Tags
No related merge requests found
...@@ -213,7 +213,7 @@ public class ScriptingResource extends AbstractCaosDBServerResource { ...@@ -213,7 +213,7 @@ public class ScriptingResource extends AbstractCaosDBServerResource {
* the call is not configured to be called by everyone, a SessionToken is returned instead. * the call is not configured to be called by everyone, a SessionToken is returned instead.
*/ */
public Object generateAuthToken(String call) { public Object generateAuthToken(String call) {
String purpose = ScriptingPermissions.PERMISSION_EXECUTION(call); String purpose = "SCRIPTING:EXECUTE:" + call;
Object authtoken = OneTimeAuthenticationToken.generateForPurpose(purpose, getUser()); Object authtoken = OneTimeAuthenticationToken.generateForPurpose(purpose, getUser());
if (authtoken != null || isAnonymous()) { if (authtoken != null || isAnonymous()) {
return authtoken; return authtoken;
......
...@@ -3,7 +3,7 @@ package caosdb.server.scripting; ...@@ -3,7 +3,7 @@ package caosdb.server.scripting;
public class ScriptingPermissions { public class ScriptingPermissions {
public static final String PERMISSION_EXECUTION(final String call) { public static final String PERMISSION_EXECUTION(final String call) {
StringBuilder ret = new StringBuilder(10 + call.length()); StringBuilder ret = new StringBuilder(18 + call.length());
ret.append("SCRIPTING:EXECUTE:"); ret.append("SCRIPTING:EXECUTE:");
ret.append(call.replace("/", ":")); ret.append(call.replace("/", ":"));
return ret.toString(); return ret.toString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment