Skip to content

App without tenancy

Not every product has tenants. An internal back-office tool might simply have admins, editors and viewers. wardn handles that with no scopes at all.

wardn.yaml
permissions:
article:view: View articles
article:edit: Edit articles
article:publish: Publish articles
user:manage: Manage users
roles:
admin: ["*"]
editor: [article:view, article:edit, article:publish]
viewer: [article:view]
w.System().Assign(ctx, "user-001", "admin", wardn.Global)
r.With(w.Require("article:publish")).Post("/articles/{id}/publish", publish)

Routes need no ScopeFrom: without one, every check happens at global, where these assignments live.

If the tool later serves several departments, add a scope type and assign roles at departments instead. Existing global assignments keep working everywhere.

scopes:
department: {}

Questions about this page?

Ask below, point out something wrong or unclear, or suggest an improvement. Reading needs no account; to post, sign in with GitHub.