- arraySeperator
arraySeperator is the character between array elements. See block term for how blocks are formatted.
- blockSeperator
blockSeperator is the character between blocks. See block term for how blocks are formatted.
- wildcard
wildcard is the character that matches any value in a block. See block term for how blocks are formatted.
- varPrefix
varPrefix is the character that prefixes variables in blocks. See block term for how blocks are formatted.
- allowPermission
allowPermission is the value used to denote an allowed rule. See permission term for how actions are checked.
- denyPermission
denyPermission is the value used to denote a denied rule. See permission term for how actions are checked.
- isAllowed(scopes, rules, vars) ⇒
Is Allowed determines whether or not the scopes are allowed with the given rules.
- validateScopes(scopeOrRules) ⇒
Error
|undefined
Determines whether or not the scopes or rules are valid according to scopie rules.
arraySeperator is the character between array elements. See block term for how blocks are formatted.
blockSeperator is the character between blocks. See block term for how blocks are formatted.
wildcard is the character that matches any value in a block. See block term for how blocks are formatted.
varPrefix is the character that prefixes variables in blocks. See block term for how blocks are formatted.
allowPermission is the value used to denote an allowed rule. See permission term for how actions are checked.
denyPermission is the value used to denote a denied rule. See permission term for how actions are checked.
Is Allowed determines whether or not the scopes are allowed with the given rules.
Kind: global function
Returns: boolean - Whether or not the scopes are allowed with the given rules.
Throws:
- Any invalid scope or rule issues, see scopie errors for possible issues.
Param | Type | Description |
---|---|---|
scopes | Array.<string> |
Scopes specifies one or more scopes our actor must match. When using more then one scope, they are treated as a series of OR conditions, and an actor will be allowed if they match any of the scopes. |
rules | Array.<string> |
Rules specifies one or more rules our requesting scopes has to have to be allowed access. |
vars | object |
An optional dictionary or map of variable to values. Variable keys should not start with @ |
Example
// returns true
isAllowed(
["accounts/thor/edit"], // scopes
["allow/accounts/@username/*"], // rules
{ "username": "thor" }, // vars
)
Determines whether or not the scopes or rules are valid according to scopie rules.
Kind: global function
Returns: Error
| undefined
- If the scope is invalid, the validation error is returned,
otherwise undefined is returned.
Param | Type | Description |
---|---|---|
scopeOrRules | Array.<string> |
Scope or rules to check |
Example
// returns undefined
validateScopes(["accounts/thor/edit"])