docs(openspec): archive add-company-scoping
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
66904869cf
commit
3c30e0d629
20 files changed
+213
-41
No files matched your search
@@ -18,22 +18,27 @@ The system SHALL list admin users only (never members), paginated on the server,
|
||||
|
||||
### Requirement: Create user
|
||||
|
||||
The system SHALL let an admin with `BO_USERS` create an admin user with name, username, email, one or more roles, and an initial password with its confirmation. Username and email SHALL be unique. The password SHALL match its confirmation and pass the admin password rules. The new user SHALL be saved with a pending password change, SHALL belong to the creating admin's company, and SHALL NOT be sent an email.
|
||||
The system SHALL let an admin with `BO_USERS` create an admin user with name, username, email, one or more roles, and an initial password with its confirmation. Username and email SHALL be unique within the user's company, so the same username or email may exist in another company. A username SHALL NOT contain `@`. The password SHALL match its confirmation and pass the admin password rules. The new user SHALL be saved with a pending password change and SHALL NOT be sent an email.
|
||||
|
||||
#### Scenario: New user
|
||||
|
||||
- **WHEN** an admin creates user `sales1` with email `sales1@example.com`, role Sales and a valid initial password
|
||||
- **THEN** the user is saved as active with a pending password change
|
||||
- **AND** `sales1` can sign in with that password and must choose a new password before anything else
|
||||
- **WHEN** an INS admin creates user `sales1` with email `sales1@example.com`, role Sales and a valid initial password
|
||||
- **THEN** the user is saved as active in INS with a pending password change
|
||||
- **AND** `sales1` can sign in with company `ins` and that password and must choose a new password before anything else
|
||||
- **AND** no email is sent
|
||||
- **AND** the user's company is the creating admin's company
|
||||
|
||||
#### Scenario: Duplicate username
|
||||
|
||||
- **GIVEN** a user `sales1` exists
|
||||
- **WHEN** an admin creates another user with username `sales1`
|
||||
- **GIVEN** a user `sales1` exists in INS
|
||||
- **WHEN** an admin creates another INS user with username `sales1`
|
||||
- **THEN** the save is refused and the form shows that the username is taken
|
||||
|
||||
#### Scenario: Same username in another company
|
||||
|
||||
- **GIVEN** a user `sales1` exists in INS
|
||||
- **WHEN** a CV admin creates user `sales1` in CV
|
||||
- **THEN** the user is created
|
||||
|
||||
#### Scenario: Weak or mismatched initial password
|
||||
|
||||
- **WHEN** an admin creates a user with a password that fails the admin password rules, or that does not match its confirmation
|
||||
@@ -97,12 +102,17 @@ The system SHALL let an admin with `BO_USERS` give an active admin user a new pa
|
||||
|
||||
### Requirement: Company membership
|
||||
|
||||
Every admin user SHALL belong to exactly one company. The company SHALL be set by the system from the creating admin, never from the request.
|
||||
Every admin user other than a super admin SHALL belong to exactly one company. A company user's new user SHALL belong to the creating user's company, whatever the request says. A super admin SHALL choose the company of a new user, or no company to create another super admin.
|
||||
|
||||
#### Scenario: Company in the request is ignored
|
||||
|
||||
- **WHEN** a create-user request carries a company id different from the admin's own
|
||||
- **THEN** the new user gets the admin's company
|
||||
- **WHEN** an INS user's create-user request carries the CV company id
|
||||
- **THEN** the new user belongs to INS
|
||||
|
||||
#### Scenario: Super admin chooses the company
|
||||
|
||||
- **WHEN** a super admin creates a user and chooses CV
|
||||
- **THEN** the new user belongs to CV
|
||||
|
||||
### Requirement: Temporary password refusals
|
||||
|
||||
|
||||
Reference in new issue
Block a user