Skip to content

Commit

Permalink
add permission tag
Browse files Browse the repository at this point in the history
  • Loading branch information
gregfrasco committed Jul 19, 2018
1 parent af19779 commit 47d4d62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/api/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const register = function (server, serverOptions) {
if (!model.routes[route].disable) {
const method = AnchorModel.routeMap[route].method.toUpperCase();
const path = AnchorModel.routeMap[route].path + model.collectionName;
permissions.push({ method, path, key: method + path });
const tag = model.collectionName;
permissions.push({ method, path, tag, key: method + path });
}
}
}
Expand All @@ -32,7 +33,8 @@ const register = function (server, serverOptions) {
if (route.path !== '/api/{collectionName}') {
const method = route.method.toUpperCase();
const path = route.path;
permissions.push({ method, path, key: method + path });
const tag = path.split('/')[2];
permissions.push({ method, path, tag, key: method + path });
}
});

Expand Down

0 comments on commit 47d4d62

Please sign in to comment.