Global

Methods

combineBlackResults(b1, b2) → {*}

Combine two sets of permissions generated from blacklists Permissions revoked from either trump permissions granted in the other If one blacklist has tables the other doesn't, its permissions are obeyed for those tables
Parameters:
Name Type Description
b1 the output from getGroupPerms for the first blacklist
b2 the output from getGroupPerms for the second blacklist
Source:
Returns:
Type
*

combinePermissionSets(tableList1, tableList2, compareFunc) → {*}

"private" function used by the functions that combine results "private" in the sense that it's not a function that is used outside of this file
Parameters:
Name Type Description
tableList1 the output from getGroupPerms
tableList2 the output from getGroupPerms
compareFunc
Source:
Returns:
Type
*

combineWhiteAndBlackResults(white, black) → {*}

Combine two sets of permissions generated from a whitelist and blacklist Permissions revoked from either trump permissions granted in the other if blacklist has tables whitelist doesn't, permissions on those tables are revoked if whitelist has tables blacklist doesn't, permissions on those tables obey whitelist permissions
Parameters:
Name Type Description
white the output from getGroupPerms for the whitelist
black the output from getGroupPerms for the blacklist
Source:
Returns:
Type
*

combineWhiteResults(w1, w2)

Combine two sets of permissions generated from whitelists Permissions granted from either trump permissions revoked in the other If one whitelist has tables the other doesn't, its permissions are obeyed for those tables
Parameters:
Name Type Description
w1 the output from getGroupPerms for the first whitelist
w2 the output from getGroupPerms for the second whitelist
Source:

getGroupPerms(groups, permSpecs, isBlackList) → {*}

Get the permissions of a given user based on the groups he/she belongs to
Parameters:
Name Type Default Description
groups an array of the groups the user belongs to
permSpecs a json object specifying which permissions to grant for which groups on which resources (see test files for examples)
isBlackList false whether or not the permSpecs are a blacklist, defaults to false (a whitelist)
Source:
Returns:
an object with tables for keys and CRUD permissions for values (e.g. {c:false,r:true,u:false,d:false} == read only)
Type
*

hasPerm(table, groups, action, permSpecs) → {boolean}

check to see if the groups that the user is in grants him/her permission to do the given action on the given resource
Parameters:
Name Type Description
table the table/resource upon which the action would be performed
groups and array of group names
action String can be 'c', 'r', 'u', or 'd'
permSpecs the permission specifications
Source:
Returns:
Type
boolean

invertResults(userPerms)

invert the given permissions
Parameters:
Name Type Description
userPerms this is the output from getGroupPerms
Source: