Skip to content

Commit

Permalink
fix: Include http methods for route rules
Browse files Browse the repository at this point in the history
  • Loading branch information
farukaydin committed Feb 19, 2024
1 parent 1361cbc commit 9e98aeb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/backend/src/helpers/authorization.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
const authorizationList = {
'/api/v1/users/:userId': {
'GET /api/v1/users/:userId': {
action: 'read',
subject: 'User',
},
'/api/v1/users/': {
'GET /api/v1/users/': {
action: 'read',
subject: 'User',
},
};

export const authorizeUser = async (request, response, next) => {
const currentRoute = request.baseUrl + request.route.path;
const currentRoute =
request.method + ' ' + request.baseUrl + request.route.path;
const currentRouteRule = authorizationList[currentRoute];

try {
Expand Down

0 comments on commit 9e98aeb

Please sign in to comment.