3

When designing an activity-based authorization system, how should additional conditional checks be handled?

For example, I have the following authority:

VIEW_COMPANY_TRANSACTIONS

which allows the user to hit the endpoint

GET /company/{companyName}/transactions

However, what if my authority VIEW_COMPANY_TRANSACTIONS has other restrictions based on the activity parameters that in fact make the authority effectively VIEW_COMPANY_TRANSACTIONS(companyName=company_a). I don't want to encode that information into the authority system, and end up with the following new authority:

VIEW_COMPANY_TRANSACTIONS_FOR_COMPANY_A

The above authority seems to mix up the filtering of the views and the authority itself which makes everything somewhat tedious and inflexible.

In another example, I have the following authority:

APPROVE_TRANSACTION

which allows the user to hit the endpoint:

POST /company/{companyName}/transactions/{id}/approvals

But what if the approval can only be done if the transaction.amount < maxAmount in which case, it's even harder to encode this into a new hardcoded authority.

Note that these authorities may also be included in a JWT token, so they must somewhat transferable as well.

What's the best way to design such a system? Any tips?

asked Jun 17, 2017 at 5:37

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.