8000 Introduce Access History for Group/Role Access Requests by tonydelanuez · Pull Request #304 · discord/access · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Introduce Access History for Group/Role Access Requests #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, 8000 you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2025

Conversation

tonydelanuez
Copy link
Contributor
@tonydelanuez tonydelanuez commented Jun 26, 2025

Overview

This PR introduces a comprehensive access history feature for access requests by implementing user access history, role/group access history.

Problem

Previously, reviewers had no visibility into whether a user or role had current or prior access to a group. This made it difficult to enforce least privilege and avoid redundant direct access.

Solution

  • Adds an access history section to access request review pages, showing current and past access for the requesting user or role to the target group.
  • Displays both direct and role-based access, with clear summaries and empty states.
  • Generalizes the access history logic into a single, context-aware component that adapts to both user-group and role-group requests.
  • Standardizes UI/UX with collapsible cards, info icons, and clear, concise messaging.

Examples

Group Request

User has no previous access

image

Role request

Role has no current access/membership in group, but previously did

image

…equest flow

Display a user’s current and past access history to the requested group on the access request review page.

Show both direct and role-based access, with clear indication of access method and duration.

Add a section suggesting alternative role-based access if the user does not already have access via a role, encouraging best practices for access management.

Always show both “Current Access” and “Past Access” tables, even if empty, for reviewer clarity.

Rationale: This gives approvers full context on whether a user is requesting new access, renewing, or already has access (directly or via a role), and encourages granting access via roles for better maintainability, auditability, and least privilege.
…uests

Refactored UserAccessHistory to a generalized AccessHistory component that adapts to both user-group and role-group contexts.
Accepts subjectType ('user' or 'role'), subjectName, groupName, and auditHistory props.
Dynamically updates headings, summary, and info messages based on context.
Ensures no “User” language appears in role requests, and vice versa.
Updated role request flow to use role-group audit history (useGetGroupRoleAudits with role_id and group_id), fixing the issue where role access history was not shown.
Updated AccessHistoryTable to accept both OktaUserGroupMember[] and RoleGroupMap[] for flexible audit display.
Standardized info/empty state cards and made access history and alternative role suggestion cards collapsible for a cleaner UI.
Removed the old UserAccessHistory file and updated all imports/usages to use the new AccessHistory component.
Improved type safety and maintainability by unifying logic and reducing duplication.
Remove usage of secondary color
Remove unnecessary files
Copy link
Collaborator
@somethingnew2-0 somethingnew2-0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for adding this!

Include <hr /> to break up Current / Past sections

Co-authored-by: Peter C <somethingnew2-0@users.noreply.github.com>
@tonydelanuez
Copy link
Contributor Author

image
After adding a <hr /> to split Current / Previous access.

@tonydelanuez tonydelanuez merged commit 6e8a7fe into main Jul 1, 2025
6 checks passed
@tonydelanuez tonydelanuez deleted the tdelanuez/historical-access branch July 1, 2025 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment 5BB6
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0