You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the heart of the system: checking permissions. It's very simply; you pass the user object, the permission descriptor (string), and the object descriptor (string). Here are a few examples:
191
191
192
192
```javascript
193
-
var tp =require('../dist/trivialperms');
193
+
consttp=require('../dist/trivialperms');
194
194
195
195
// Setup
196
-
var loading =tp.loadGroups([
196
+
constloading=tp.loadGroups([
197
197
{
198
198
name:"Administrators",
199
199
permissions: [
@@ -217,18 +217,18 @@ var loading = tp.loadGroups([
217
217
]);
218
218
219
219
// Define Users
220
-
var batman = {
220
+
constbatman= {
221
221
name:'batman',
222
222
groups: ['Administrators']
223
223
};
224
224
225
-
var stark = {
225
+
conststark= {
226
226
name:'tstark',
227
227
permissions: ['*/*'],
228
228
groups: ['Users']
229
229
};
230
230
231
-
var leo = {
231
+
constleo= {
232
232
name:'lblume',
233
233
groups: ['Users']
234
234
};
@@ -260,10 +260,10 @@ about simply seeing if `groupName` is in the list of groups on the user: `hasGro
260
260
not been defined, regardless of is the user has that group name in their list of groups.
261
261
262
262
```javascript
263
-
var tp =require('../dist/trivialperms');
263
+
consttp=require('../dist/trivialperms');
264
264
265
265
// Setup
266
-
var loading =tp.loadGroups([
266
+
constloading=tp.loadGroups([
267
267
{
268
268
name:"Administrators",
269
269
permissions: [
@@ -287,18 +287,18 @@ var loading = tp.loadGroups([
0 commit comments