Authorization
Authorization is managed at three levels:
- spaces: who can access a space, and with which mode
- agencies: which agencies a user can use inside a space
- datasets: optional per-dataset restrictions.
It uses users, groups and API keys. A request is allowed only when every applicable layer allows it.
Space-Based Authorization
A space is configured with these properties:
read and write are independent. A space can be publicly readable and
member-writable at the same time.
Space modes
The space permissions come from roles:
public is applied per action:
- a public read ignores the ACL and the agency layer for read
- a public write ignores the ACL and the agency layer for write
- the other action still follows its own mode.
External spaces
An external space has external: true.
- Read follows the normal space rules.
- Write is always denied, including for administrators. Because write is never
evaluated, an
acl.writeentry cannot grant read on an external space. - Dataset ACLs still apply to reads.
Administrators
An administrator is a user with the admin role:
- an admin with no
memberslist is a super admin - an admin with a
memberslist is an admin only of those members.
Administrators bypass space checks, agency checks and dataset ACLs for the members they administer. They can always read an external space, but cannot write it. An admin of another member does not get this bypass.
ACL Space-Based Authorization
An ACL restricts an action to a list of users, groups or API keys. ACL is active when
space.acl contains at least one of read or write as an array.
In this example:
u1, all users in groupg1, and API key1234can readu2can write and read.
ACL rules:
- entries are ORed: at least one entry must match
{ "email": "..." }matches a user email{ "group": "..." }matches an entry{ "id": "..." }ingroups{ "apiKey": "..." }matches an apiKey- the user must belong to the space's member. ACLs never grant membership
- An active ACL replaces only the space-role requirement: a matching entry grants the action even if the user does not have space viewer or editor role. It does not replace membership: non-admin users must still belong to the space's member
- when write is ACL-controlled (the write mode is not
public), a matchingacl.writeentry grants both write and read - a missing
readorwriteside is an empty list, so it grants nothing directly.writeentry can still grant read - a public space action ignores the ACL for that action: space.read = 'public' ignores acl.read
- administrators of the member bypass the ACL for internal spaces
An ACL only replaces the space-level check. If the access mode is member
or agency, the agency layer is still evaluated afterwards.
Agency-Based Authorization
The agency layer defines which agencies a user can access inside a space. It is evaluated only when access modes are member or agency.
For public mode, agency checks are skipped.
The two modes offer opposite behaviors:
member: all agencies are allowedagency: all agencies are denied.
User-level agency rights
User's agency rights are stored in each member entry:
An agency with no user-level agency entry follows the space-level agency, or the access mode.
User-level agency rights are hierarchical:
AG1applies toAG1.SUB,AG1.SUB.DETAIL, etc.- the nearest entry wins
- a child entry overrides a parent entry, including
"" - a child entry does not define its parent.
Space-level agency rights
Behavior:
readandwriteare independent- an array is a list of conditions, combined with OR
- there is no AND between conditions
[]is an explicit deny- an entry with no
readorwritearray, such as{}, is ignored - a space-level agency right for an action completely overrides the user-level agency right for that action. It can grant or deny, even if the user-level agency right is
Wor"" - if no space-level agency right exists in the agency's chain for an action, the user-level agency right and the mode default apply.
Complete override:
Space-level agency rights can grant access to a user with R, "", or no
user-level agency right, provided the user is a member of the space's member.
Space-level agency rights never grant membership.
Conditions
Conditions are ORed. An email condition never matches an API key use an
apiKey condition for API keys. The old { "agency": "*" } condition is no
longer supported and matches nobody.
Agency hierarchy
Agency IDs use dots. AG1.SUB is a child of AG1.
For a given action, sxs looks for the most specific space-level agency right and applies it to the whole subtree:
AG1andAG1.OTHERuse theAG1rightsAG1.SUBand its children are denied for readAG1.SUBand its children usesub-editor@x.frfor write- a child that only defines
writestill inherits the parent'sreadright - a child entry does not define its parent: if only
AG1.SUBis configured,AG1has no space-level agency right.
Choosing between member and agency
- Use
memberwhen users with no member-level agency right should be allowed by default. Add space-level agency rights only for the agencies you want to restrict. Missing space-level rights fall back to the member-level agency right, or to thememberdefault if there is no member-level right. - Use
agencywhen users with no member-level agency right should be denied by default. They need a matching space-level agency right or a member-level agency right. An agency with neither is denied.
Both modes apply space-level agency rights; member does not ignore them.
Dataset-Based Authorization
A dataset can have its own ACL in _meta.acl. It is configured per dataset,
through Xplor:
Dataset ACL rules:
- conditions support
emailandgrouponlyapiKeyis not supported - entries are ORed
- read conditions are the union of
readandwrite: a write entry also grants read - write conditions come from
writeonly - if
writeis absent, there is no dataset-level write restriction - if
writeis present, only matching entries can write - if
readis absent butwriteis present, read uses thewriteentries - if a side is present but empty, it grants nothing:
write: []denies write, andread: []denies read when nowriteentry matches - when the dataset ACL restricts the action, non-admin users must belong to the member
- administrators of the member bypass the dataset ACL for read and write, even when the ACL is empty or does not match
- a new dataset version follows the same write ACL and inherits the ACL of the previous version.
Administrators of the member bypass this table: they can read and write the
dataset regardless of _meta.acl.
For non-admin users, a dataset ACL is ANDed with space and agency access.
Order of Checks
Every applicable layer must allow. If one layer denies, the request is denied.
sxs Objects
tenants.json defines members and spaces:
Users and groups are created in Confy and provided by the auth server:
API keys are created in Confy. They use the same roles and
members[].agencies map as users:
Use an API key with a Basic Authorization header:
Use Cases
Public read, write restricted to member users
Space disseminate is publicly readable, but only orox editors can write:
Read is public. Write requires membership in orox and sxs:spaces:write.
Read and write restricted to member users
Read requires sxs:spaces:read write requires sxs:spaces:write.
Write restricted by an ACL
Only listed users or groups can write, regardless of their space roles:
- matching
acl.writegrants write and read, sou1andu2can read even withoutsxs:spaces:read u3does not match the ACL, so write is denied, and read is denied because the active ACL has noreadentries.
Restrict write access to specific agencies
All orox editors can write, except on SDMX.SAMPLE, which is reserved for
the sample-editors group:
write: memberallows all editors by default- the
SDMX.SAMPLEspace-level agency right overrides that default for the agency and its children SDMX.OTHERhas no space-level agency right, so thememberdefault applies- a denied agency write is rejected with
403.
To use agency mode instead, users without a member-level agency right will be
denied unless a space-level agency right matches. An agency with neither a
space-level agency right nor a member-level agency right is denied.
Summary
- Every applicable layer must allow.
publicignores ACL and agency checks for that action.memberandagencyrequire membership and the space permission, unless an ACL replaces the space check.- An ACL is active when
space.aclhas areadorwritearray. A matchingwriteentry also grants read. - Space-level agency rights (
space.agencies) apply in bothmemberandagencymodes and override the member-level agency rights for that action. - In
agencymode, an agency with no space-level agency right and no member-level agency right is denied. Inmembermode, it is allowed. - Member-level agency rights are
R,RW, or""; missing means the mode default. - Dataset ACLs are separate: read uses
readpluswrite, write useswrite, and a missing write side means no write restriction. - Administrators bypass space checks, agency checks and dataset ACLs for the members they administer. They can read external spaces but cannot write them.
