If I want to use a hash table to find the permissions, the permission processing should be placed in the middleware.
For example, for the GET /users route, the permissions I indicate are users.read
But for the GET /users/:id route, the actual value may be /users/1, so the hash key is difficult to write
女神的闺蜜爱上我2017-06-23 09:13:32
From /users/1, find the route GET /users/:id, and then determine permission control based on this route.
给我你的怀抱2017-06-23 09:13:32
Regular matching to obtain the id value, and then hget to obtain permissions. However, this suggestion is written in lua on the nginx module. There is no need to let the request go to the application stage