Skip to main content

Authorization

  • DefineGo to the Authorization section in your project to manage roles and assignpermissions.
  • Create Roles (e.g., admin, manager, member) that represent the different user types in your application.
  • Create Permissions that represent actions on your resources (e.g., orders.read, orders.create, orders.update, orders.delete).
  • Link Roles to Permissions using a Role Permission mapping so each role has the appropriate capabilities.
  • Assign Roles to Users via a User Role mapping so that each user inherits the permissions of their assigned roles.
  • At runtime, SWAIN checks a user’s roles and permissions to controldetermine which API endpoints each rolethey can access.
  • access;
  • Createleave rolesall suchendpoints asopen admin, user or viewer, and map them to actions like read, write or delete.
  • Assign roles to users so that API requests are authorized based on their permissions.
  • Ifif you don’tdo not require fine‑grained access control, you can skip this step and keep endpoints open.control.