Bird
0
0

Which of the following JSON snippets correctly represents a role with permissions in an RBAC microservice?

easy📝 Conceptual Q3 of 15
Microservices - Authentication and Authorization
Which of the following JSON snippets correctly represents a role with permissions in an RBAC microservice?
A{"role": "guest", "actions": "read"}
B{"user": "admin", "access": ["read", "write"]}
C{"role": "admin", "permissions": ["read", "write", "delete"]}
D{"permission": "admin", "roles": ["read", "write"]}
Step-by-Step Solution
Solution:
  1. Step 1: Check correct RBAC structure

    RBAC roles have a 'role' key and a list of 'permissions'.
  2. Step 2: Validate JSON keys and values

    {"role": "admin", "permissions": ["read", "write", "delete"]} correctly uses 'role' and 'permissions' with an array of actions.
  3. Final Answer:

    {"role": "admin", "permissions": ["read", "write", "delete"]} -> Option C
  4. Quick Check:

    Correct RBAC JSON = role + permissions array [OK]
Quick Trick: Roles map to permissions array in JSON [OK]
Common Mistakes:
MISTAKES
  • Using 'user' instead of 'role'
  • Permissions as string instead of array
  • Swapping keys 'role' and 'permission'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes