Feature breakdown · built with CraftHQ
User management and roles
Whole-team time at this build's pace
2 people incl. the product owner, requirements to merge
Estimate at this build's pace, not a measurement of this feature
Admins control who has access and in what role, and deactivation revokes a user's sessions at once.
How long a feature this size usually takes
Whole-team time — this build vs a typical team
35 FP · FP × 6.8 to 9.4 h (ISBSG 2023)
Estimate at this build's pace, not a measurement of this feature
Both figures are whole-team time over the whole lifecycle, so they compare like for like. Ours is this build's pace — about 0.8 hours per function point across the whole build (two people, including the product owner, with requirements and review time). The industry range is an ISBSG project-level figure applied to one feature, so it is indicative.
Workflow
How it moved through the workflow
Select a stage. The build shipped, so every stage is complete; a person approved the merge.
Request
Admins need to add, edit, deactivate, reactivate and reassign users with roles, with deactivation taking effect at once.
Questions
Two decisions went to the business before building: what happens to a deactivated user's work, and whether to notify a user on deactivation.
Approved
The product owner signs off the breakdown by moving the story into the approved state, and the build runs against that reference.
Definition of ready
Building
CraftHQ's build agents write the code and the tests together, run as a loop; a failing check halts the work until it passes.
Checks
Three checks run on every pull request: one on the product owner's machine as CraftHQ builds, one on the engineer's machine before review, and a code-quality scan in CI. Merging is gated by the CI check passing and a person's approval, enforced by branch protection.
Review
An engineer reviews the pull request and merges it.
Merged
The pull request is merged to main after a person approves it. Nothing merges without that approval.
Definition of done
Breakdown
The feature breakdown
Business first, then the engineering view. Tab through it.
Overview
The gap it closes
Access has to track who is actually on the team, and when someone leaves their access and their work need to be handled cleanly.
Who uses it
Administrators, who manage the user list and roles for their organisation.
User story
As an admin, I want to add, edit, deactivate and reassign users with roles so that access always matches who is actually on the team.
Examples
Example 1
An admin adds a new team member with a role, and they appear in the searchable register straight away.
Example 2
An admin deactivates a user who is currently signed in. The user's sessions are revoked at once, the user is sent a notice at their work email, and their work is reassigned to a new owner.
Dependencies & risks
Depends on
A user store with roles and status, and the session store so deactivation can revoke access.
Risk & mitigation
A deactivated user's work could be orphaned. Reduced by whole-account reassignment, so nothing is lost.
How it works
Simplified diagrams of the parts involved, the steps of one request, and where it runs.
Architecture
- 1view and search
- 2add or edit
- 3save the user
- 4revoke on deactivate
- 5record the change
Sequence
- 1deactivate a user
- 2set the user inactive
- 3revoke the user's sessions
- 4record the change
- 5confirm and prompt to reassign
Infrastructure
- 1manage users
- 2read and write users and sessions
Acceptance criteria
Each scenario is written as a Gherkin spec. The Engineering tab shows the test that covers each one, or notes where it was verified by review.
@users-access @adminFeature: User management and rolesAs an adminI want to add, edit, deactivate and reassign users with rolesSo that access always matches who is actually on the teamAdmins manage the whole user list from a searchable register, and deactivation takes effect at once.Background:Given an admin is signed inAnd the user register is searchable and pagedRule: Only an admin may manage usersScenario: A non-admin cannot reach the admin actionsGiven a staff member without the admin roleWhen they call an add, edit, deactivate or reassign actionThen the action is refused on the server, not only hidden in the screenRule: An admin manages users from the registerScenario: Add a userGiven an admin opens the add-user formWhen they enter a valid user with a roleThen the user is added to the registerScenario: Edit a userGiven a user exists in the registerWhen an admin edits the user's details or roleThen the changes are savedRule: The data guards refuse invalid usersScenario Outline: A bad user entry is refused with the real reasonGiven an admin is adding or editing a userWhen the entry has "<fault>"Then it is refused and the message names the real reasonExamples:| fault || an email in the wrong format || an email on a domain not allowed || an email already used by a user |Rule: The admin set cannot be emptied and an admin cannot lock themselves outScenario: An admin cannot deactivate themselvesGiven an admin is signed inWhen they try to deactivate their own accountThen the action is refusedScenario: The active-admin count cannot drop below twoGiven there are exactly two active administratorsWhen an admin tries to deactivate or downgrade one of themThen the action is refused, because at least two active administrators must remainRule: Deactivation takes effect immediatelyScenario: Deactivating a user revokes access and notifies themGiven a user is active and signed inWhen an admin deactivates the userThen the user's sessions are revoked at onceAnd the user is sent a notice at their work emailScenario: A role change on a signed-in user ends their sessionGiven a user is signed inWhen an admin changes that user's roleThen the user's session ends and the new role applies on their next sign-inScenario: Reactivating a user restores accessGiven a user is deactivatedWhen an admin reactivates the userThen the user can sign in againRule: A deactivated user's work is reassigned, not lostScenario: Reassign a whole account's workGiven a user owns work in the systemWhen an admin reassigns that user's account to an active userThen all of the user's work moves to the new ownerScenario Outline: An invalid reassignment target is refusedGiven a user owns work in the systemWhen an admin reassigns the account to "<target>"Then the reassignment is refusedExamples:| target || an inactive user || the reviewer of that user's own item |Rule: The register can be exportedScenario: Exporting the register records who exported itGiven an admin is viewing the user registerWhen they export itThen the export matches the current listAnd the register export is administrator-only and writes an audit row, and a build check flags any new export column
Questions
Questions raised in planning, each with the decision taken.
What happens to a deactivated user's work?
If a user leaves, their in-flight work cannot just disappear or stay locked to a disabled account.
Should a user be notified when they are deactivated?
A notice tells the person and keeps a record that access was removed.
How we sized it
A function point measures what the software does — its inputs, outputs, lookups and the data it stores — regardless of language or how many lines it took. Each counted item is weighted by complexity: a user input counts 3–6 points, an output or report 4–7, a lookup 3–6, data the feature owns 7–10, and data read from elsewhere 5–7.
- The user records this feature ownsData the feature owns10
- Add a userUser input4
- Edit a userUser input4
- Deactivate or reactivate a userUser input4
- View and search usersLookup4
- Export the user listOutput or report5
- Reassign a user's workUser input4
- Total35
Components touched
User store
Holds users with role flags and an active status.
Register
A searchable, paged list of users with an export.
Add/Edit form
A fixed-layout form shared by add and edit, with error messages that name the real reason.
Deactivate and revoke
Deactivation revokes the user's sessions at once and sends a notice; reactivation restores sign-in.
Reassignment
Moves a whole account's work to a new owner.
Data touched
User storewrite
Users, roles and status. The guards keep at least two active administrators, stop a user from deactivating their own account, and require a user's customer assignments to be reassigned before the user is deactivated.
Sessionswrite
Revoked when a user is deactivated.
Audit logappend
Add, edit, deactivate, reactivate and reassign events.
Security decisions
- Access is governed by one central permission catalogue shared by the server and the web; every non-public route declares a permission and is checked on the server, failing closed, so hiding a control in the web nav is only a convenience, not the control. An administrator is a single flag, not a superuser.
- Only an admin role reaches the add, edit, deactivate and reassign actions, enforced on the server.
- Deactivation revokes the user's sessions at once (a version bump), and a role change ends the user's current session.
- The guards keep at least two active administrators and refuse a self-deactivation.
- The register export is a sensitive output: it is administrator-only and writes an audit row, and a build check flags any new export column (the same control as Tabular data export).
- A whole-account reassignment keeps a departed user's work with an active owner.
Subtasks
- A user store with role flags and status.
- A searchable, paged register with an export.
- An Add/Edit form to a fixed layout.
- A deactivate-and-revoke path with a notice, and reactivation.
- Whole-account reassignment.
How each scenario is verified
- A non-admin cannot reach the admin actionsAn access and permissions test confirms a non-admin is denied every management route on the server (403), an unknown permission key denies every role, and a customer-portal user is refused a staff-only permission.
- Deactivating a user revokes access at onceAn identity test confirms a deactivated user loses access immediately through a version bump.
- At least two active administrators remainAn access test covers the at-least-two-active-admins guard and the reassign-a-governing-mapping-first rule before deactivation.
- Role union and tenant isolationA test confirms a member's access is the union of their per-customer roles, and email uniqueness is case-insensitive per tenant.
- The register export is admin-onlyA customer-record test confirms the register export is restricted to administrators (others get 403).
Risk tier
Core A person approves every merge. This is a Core-tier change, so it also carries the fullest set of automated tests; a regression here affects the whole product, not one page.
Start here
Want this on your backlog?
Get a free baseline report on one repository, or scope a 3-month pilot measured against what your team’s work costs today.