Skip to end of banner
Go to start of banner

Writing Security Scripts

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

Security scripts are SIL scripts that return a specific format - a boolean array of four values, each of them corresponding to a certain action (SET, INSERT, UPDATE, DELETE).

The basic syntax for a security script return is this:

return {<SET true/false>, <INSERT true/false>, <UPDATE true/false>, <DELETE true/false>};

With the SIL scripts you can create complex permission schemes based on groups, project roles, etc.

In the example below only a member of the “data-managers” group has permission to edit the values in the database:

boolean SET = true;
boolean INSERT = false;
boolean UPDATE = false;
boolean DELETE = false;

if(isUserInGroup("data-managers", currentUser())) {
    INSERT = true;
    UPDATE = true;
    DELETE = true;
}

return {SET, INSERT, UPDATE, DELETE};

  • No labels