Authentication & Tenant Administration Use Cases
Use cases for authentication, multi-tenancy, user management, and system configuration
Authentication & Tenant Administration Use Cases
This document describes use cases for authentication, multi-tenancy, user management, tagging configuration, and system administration.
Actors
| Actor | Description |
|---|---|
| Platform Admin | System-wide administrator (SaaS operations) |
| Tenant Admin | Organization administrator (HR Director, Office Manager) |
| Manager | Team manager with user management permissions |
| Employee | Regular authenticated user |
UC-AUTH-01: User Login
Primary Actor: Employee, Manager, Tenant Admin
Preconditions
- User has an active account
- User knows their credentials
Main Flow
- User navigates to login page
- User enters email and password
- System validates credentials
- If user belongs to multiple tenants, system shows tenant selector
- User selects tenant (or auto-selects if only one)
- System creates session and redirects to dashboard
Alternative Flows
A1: Invalid Credentials
- System displays "Invalid email or password" error
- User can retry (max 5 attempts)
A2: Account Locked
- After 5 failed attempts, account is locked for 15 minutes
- System displays lock message with unlock time
A3: Password Reset Required
- If password expired, system redirects to password reset
- User must set new password before continuing
Postconditions
- User is authenticated
- Session is created with tenant context
- Audit log records login event
UC-AUTH-02: Tenant Admin Creates Organization
Primary Actor: Tenant Admin (initial setup)
Preconditions
- User has signed up for the platform
- User has verified their email
Main Flow
- User completes signup form
- System creates user account
- User enters company details:
- Company name
- Industry
- Size (employee count range)
- Country/timezone
- System creates tenant with default configuration:
- Default roles (Admin, Manager, Employee)
- Default leave types (Vacation, Sick, Personal)
- Default permissions matrix
- User is assigned Tenant Admin role
- System redirects to onboarding wizard
Alternative Flows
A1: Company Name Already Exists
- System suggests adding identifier (e.g., "Acme Inc - NYC")
- User modifies company name
Postconditions
- New tenant is created and active
- User is Tenant Admin of the new tenant
- Default configuration is applied
- Welcome email sent with getting started guide
UC-AUTH-03: Tenant Admin Invites Users
Primary Actor: Tenant Admin
Preconditions
- Tenant Admin is authenticated
- User to invite does not exist in tenant
Main Flow
- Tenant Admin navigates to User Management
- Clicks "Invite User"
- Enters user details:
- Email address
- First name, Last name
- Role (Admin, Manager, or Employee)
- Department (optional)
- System validates email is not already in tenant
- System sends invitation email with secure link
- Invitation appears in pending invitations list
Alternative Flows
A1: Email Already Exists in Tenant
- System displays "User already exists" error
- Offers to navigate to existing user's profile
A2: Email Exists in Different Tenant
- System creates invitation (user can belong to multiple tenants)
- When user accepts, they can switch between tenants
A3: Invitation Expires
- Link expires after 7 days
- Tenant Admin can resend invitation
Postconditions
- Invitation record created with status PENDING
- Email sent to invitee
- Audit log records invitation
Business Rules
- Invitation links are single-use and expire after 7 days
- Users can be invited to multiple tenants
UC-AUTH-04: Tenant Admin Manages Users
Primary Actor: Tenant Admin
Preconditions
- Tenant Admin is authenticated
- Users exist in the tenant
Main Flow
- Tenant Admin navigates to User Management
- Views list of users with:
- Name, email, role
- Status (active, inactive, pending)
- Last login date
- Selects a user to manage
- Can perform actions:
- Edit user details
- Change role
- Reset password
- Deactivate/reactivate account
Alternative Flows
A1: Cannot Deactivate Last Admin
- System prevents deactivation
- Displays "Cannot deactivate the last administrator"
A2: Deactivating User with Pending Approvals
- System warns about pending items
- Requires reassignment or confirmation to proceed
Postconditions
- User account updated
- Audit trail records all changes
- If deactivated, user's sessions are invalidated
Business Rules
- Must always have at least one active Tenant Admin
- Deactivated users retain data but cannot login
- Role changes take effect immediately
UC-AUTH-05: Tenant Admin System Dashboard
Primary Actor: Tenant Admin
Preconditions
- Tenant Admin is authenticated
Main Flow
- Tenant Admin accesses Admin Dashboard
- Views system metrics:
- Total users (active, inactive, pending invitations)
- Storage usage (documents, attachments)
- Recent activity summary
- Pending approvals count
- Views quick actions:
- Invite user
- View pending invitations
- Access settings
- Views system health indicators:
- API response times
- Error rate (last 24 hours)
Alternative Flows
A1: High Error Rate Detected
- Dashboard highlights warning
- Links to error details and support contact
Postconditions
- Admin has overview of tenant health
- No data is modified (read-only view)
UC-AUTH-06: User Switches Tenant Context
Primary Actor: Employee (multi-tenant user)
Preconditions
- User belongs to multiple tenants
- User is authenticated
Main Flow
- User clicks tenant selector in header
- System displays list of available tenants
- User selects different tenant
- System switches context:
- Updates session tenant ID
- Refreshes navigation and permissions
- Redirects to new tenant's dashboard
- All data now filtered to selected tenant
Alternative Flows
A1: Tenant Access Revoked
- If user was removed from tenant, it no longer appears
- System handles gracefully if current tenant is revoked
Postconditions
- Session updated with new tenant context
- UI reflects new tenant's data and branding
- Audit log records context switch
UC-AUTH-07: Logout
Primary Actor: All users
Preconditions
- User is authenticated
Main Flow
- User clicks Logout
- System invalidates session
- System clears local storage/cookies
- User is redirected to login page
Alternative Flows
A1: Session Already Expired
- User is already logged out
- Redirect to login page without error
Postconditions
- Session is invalidated
- User must re-authenticate to access system
- Audit log records logout event
UC-AUTH-08: Tenant Admin Configures Tag Categories
Primary Actor: Tenant Admin
Preconditions
- Tenant Admin is authenticated
- Has access to system configuration
Main Flow
- Tenant Admin navigates to Settings → Tags
- Selects asset type to configure:
- Employee
- Document
- Department
- Goal
- Views existing tags for that asset type
- Creates new tag:
- Name (unique within asset type)
- Color (hex code or preset)
- Description (optional)
- Saves tag
- Tag becomes available for assignment
Alternative Flows
A1: Tag Name Already Exists
- System displays "Tag name already exists" error
- User must choose unique name
A2: Editing Existing Tag
- User selects existing tag
- Can modify name, color, description
- Changes apply to all tagged items
A3: Deleting Tag
- User selects tag to delete
- System warns about items currently using tag
- On confirmation, tag is removed from all items
Postconditions
- Tag is created/updated/deleted
- Available for assignment to assets of that type
- Audit log records configuration change
Example Tags by Asset Type
| Asset Type | Example Tags |
|---|---|
| Employee | "Expat", "Remote", "Part-time", "Contractor", "VIP", "Intern" |
| Document | "Contract", "Policy", "Onboarding", "Confidential", "Template", "Expired" |
| Department | "Cost Center", "Revenue", "Support", "HQ", "Remote Office" |
| Goal | "Strategic", "Personal", "Team", "Quarterly", "Annual" |
UC-AUTH-09: Tenant Admin Manages Tag Permissions
Primary Actor: Tenant Admin
Preconditions
- Tenant Admin is authenticated
- Tags are configured for at least one asset type
Main Flow
- Tenant Admin navigates to Settings → Tags → Permissions
- For each asset type, configures who can:
- Create tags: Admin-only or Manager+
- Assign tags: Admin-only, Manager+, or All users
- Remove tags: Admin-only, Manager+, or All users
- Saves permission configuration
Alternative Flows
A1: Restrictive Permissions on Existing Tags
- If tightening permissions, existing assignments remain
- New assignments follow new rules
Postconditions
- Tag permission rules are saved
- Enforced on all tag operations
Permission Levels
| Level | Who Can Act |
|---|---|
| Admin-only | Only Tenant Administrators |
| Manager+ | Managers and Tenant Administrators |
| All users | Any authenticated user (for their own assets) |
Summary
| Use Case | Primary Actor | Purpose |
|---|---|---|
| UC-AUTH-01 | All users | Authenticate and access system |
| UC-AUTH-02 | Tenant Admin | Create new organization |
| UC-AUTH-03 | Tenant Admin | Invite users to organization |
| UC-AUTH-04 | Tenant Admin | Manage existing users |
| UC-AUTH-05 | Tenant Admin | View system dashboard |
| UC-AUTH-06 | Multi-tenant user | Switch between organizations |
| UC-AUTH-07 | All users | Securely end session |
| UC-AUTH-08 | Tenant Admin | Configure tagging categories |
| UC-AUTH-09 | Tenant Admin | Set tag permissions |
AI Chat Integration
The following authentication and admin use cases can be triggered via AI Chat. See AI Chat Specification for full implementation details.
AI Chat-Enabled Actions
| Use Case | AI Tool | Requires Confirmation |
|---|---|---|
| UC-AUTH-03 | Admin action (not AI) | N/A |
| UC-AUTH-04 | Admin action (not AI) | N/A |
| UC-AUTH-08 | Admin action (not AI) | N/A |
Note: Most authentication and admin actions are security-sensitive and are NOT available via AI Chat. These require direct UI interaction for security reasons.
What AI Chat CAN Do for Admin Users
While AI Chat cannot perform most admin actions directly, it can help admin users with:
Information Queries:
- "How many active users do we have?"
- "When was the last user invited?"
- "Show me users who haven't logged in recently"
- "What tags are configured?"
Example Flow:
User: "How many users haven't logged in this month?"
AI: Shows Info Card
┌─────────────────────────────────────────────┐
│ Inactive Users This Month │
│ │
│ 3 users have not logged in since Dec 1: │
│ │
│ - john.doe@company.com │
│ Last login: Nov 15, 2024 │
│ │
│ - jane.smith@company.com │
│ Last login: Nov 22, 2024 │
│ │
│ - mike.chen@company.com │
│ Last login: Nov 28, 2024 │
│ │
│ [View in User Management] │
└─────────────────────────────────────────────┘Security Restrictions
| Action | AI Chat Available | Reason |
|---|---|---|
| User login | No | Security - requires direct auth |
| Invite users | No | Security - email verification needed |
| Deactivate users | No | Security - sensitive action |
| Change permissions | No | Security - sensitive action |
| Configure SSO | No | Security - sensitive action |
| View user list | Yes (read-only) | Information only |
| View tag configuration | Yes (read-only) | Information only |