All features

Feature breakdown · built with CraftHQ

Users & accessAdmin

User management and roles

Whole-team time at this build's pace

Estimated ~28 h

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.

Size: 35 FP · In-house IFPUG-style count, cross-checked by a second counter; not certified. Range 30 to 40. · How we counted 35 FP

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)

Whole-team time at this build's pace2 people incl. the product owner, requirements to merge
~28 h24 to 32 h

Estimate at this build's pace, not a measurement of this feature

A typical team, whole lifecycleRequirements to release · middle half of 512 comparable projects (Java, Agile), ISBSG 2023
~238 to 329 habout 6–8 person-weeksmedian ~277 h
grey band = a typical team, middle halfhatched = our whole-team estimate

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

The questions are answered.
The acceptance criteria are testable.
The size is estimated.
The scope is checked for splitting.
The product owner has signed off.

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

Every acceptance criterion is checked; where a scenario has a dedicated test it is cited, and where it was verified by review that is stated.
The three checks are green.
A person approved the merge.

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

People
Adminmanages users
Your app
User registersearch and page
Add/Edit formfixed layout
User storeroles and status
Sessionsrevoked on deactivate
Audit loguser events
  • 1view and search
  • 2add or edit
  • 3save the user
  • 4revoke on deactivate
  • 5record the change
Simplified.

Sequence

Browserthe admin
App serveruser management
Users + sessions + auditread and write
  • 1deactivate a user
  • 2set the user inactive
  • 3revoke the user's sessions
  • 4record the change
  • 5confirm and prompt to reassign
Simplified.

Infrastructure

Client (untrusted)
Web appthe user register
Your app
App serveruser management; authenticates, pins the tenant
Databaseper-tenant isolation, users and sessions
  • 1manage users
  • 2read and write users and sessions
Simplified.

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 @admin
Feature: User management and roles
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
Admins manage the whole user list from a searchable register, and deactivation takes effect at once.
Background:
Given an admin is signed in
And the user register is searchable and paged
Rule: Only an admin may manage users
Scenario: A non-admin cannot reach the admin actions
Given a staff member without the admin role
When they call an add, edit, deactivate or reassign action
Then the action is refused on the server, not only hidden in the screen
Rule: An admin manages users from the register
Scenario: Add a user
Given an admin opens the add-user form
When they enter a valid user with a role
Then the user is added to the register
Scenario: Edit a user
Given a user exists in the register
When an admin edits the user's details or role
Then the changes are saved
Rule: The data guards refuse invalid users
Scenario Outline: A bad user entry is refused with the real reason
Given an admin is adding or editing a user
When the entry has "<fault>"
Then it is refused and the message names the real reason
Examples:
| 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 out
Scenario: An admin cannot deactivate themselves
Given an admin is signed in
When they try to deactivate their own account
Then the action is refused
Scenario: The active-admin count cannot drop below two
Given there are exactly two active administrators
When an admin tries to deactivate or downgrade one of them
Then the action is refused, because at least two active administrators must remain
Rule: Deactivation takes effect immediately
Scenario: Deactivating a user revokes access and notifies them
Given a user is active and signed in
When an admin deactivates the user
Then the user's sessions are revoked at once
And the user is sent a notice at their work email
Scenario: A role change on a signed-in user ends their session
Given a user is signed in
When an admin changes that user's role
Then the user's session ends and the new role applies on their next sign-in
Scenario: Reactivating a user restores access
Given a user is deactivated
When an admin reactivates the user
Then the user can sign in again
Rule: A deactivated user's work is reassigned, not lost
Scenario: Reassign a whole account's work
Given a user owns work in the system
When an admin reassigns that user's account to an active user
Then all of the user's work moves to the new owner
Scenario Outline: An invalid reassignment target is refused
Given a user owns work in the system
When an admin reassigns the account to "<target>"
Then the reassignment is refused
Examples:
| target |
| an inactive user |
| the reviewer of that user's own item |
Rule: The register can be exported
Scenario: Exporting the register records who exported it
Given an admin is viewing the user register
When they export it
Then the export matches the current list
And 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.

AReassign the whole account's work to a new owner in one action. · recommended
BLeave the work with the disabled account and handle it case by case.
Decided: Whole-account reassignment (option A).

Should a user be notified when they are deactivated?

A notice tells the person and keeps a record that access was removed.

AYes. Send a notice on deactivation. · recommended
BNo notice.
Decided: Yes, send a notice (option A).

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 owns
    Data the feature owns
    10
  • Add a user
    User input
    4
  • Edit a user
    User input
    4
  • Deactivate or reactivate a user
    User input
    4
  • View and search users
    Lookup
    4
  • Export the user list
    Output or report
    5
  • Reassign a user's work
    User input
    4
  • Total
    35
35 function points (range 30–40). IFPUG-style count: each user action, lookup, output and stored data set, weighted by complexity. Technical plumbing is excluded, and a data store is counted once in the feature that owns it.

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 actions
    An 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 once
    An identity test confirms a deactivated user loses access immediately through a version bump.
  • At least two active administrators remain
    An access test covers the at-least-two-active-admins guard and the reassign-a-governing-mapping-first rule before deactivation.
  • Role union and tenant isolation
    A 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-only
    A 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.

Measured from your own git history
Every pull request tested before review
A person approves every merge