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
requirements a little loose here as we'll need to assess what's needed when we get to this point
but in general endpoints for acting on behalf of a nonprofit need to check if the current user has the right permissions
This will require adding a roles guard in the AuthModule (guard is a functionality provided by NestJs).
Inside the guard you will have to read the User-Orgs table. Each org will have a user that can be an agent. The guard logic is a pseudo code like:
This guard requires a user to be in the request
find userorg record for current user
if no userord record return false
if userOrg record for current user make sure that the org in question is in the same user-org record (there could be multiple records)
To get the authenticated user from the request, you may want to add a Cookie Guard annotation before the new guard annotation so that the Cookie guard puts the user in the middleware.
requirements a little loose here as we'll need to assess what's needed when we get to this point
but in general endpoints for acting on behalf of a nonprofit need to check if the current user has the right permissions
This will require adding a roles guard in the AuthModule (guard is a functionality provided by NestJs).
Inside the guard you will have to read the
User-Orgs
table. Each org will have a user that can be an agent. The guard logic is a pseudo code like:To get the authenticated user from the request, you may want to add a Cookie Guard annotation before the new guard annotation so that the Cookie guard puts the user in the middleware.
preReq #59
The text was updated successfully, but these errors were encountered: