Skip to content

Comments

Feat/42 admins envelope permissions#1066

Open
prasad-rtc wants to merge 3 commits intodevelopfrom
feat/42-admins-envelope-permissions
Open

Feat/42 admins envelope permissions#1066
prasad-rtc wants to merge 3 commits intodevelopfrom
feat/42-admins-envelope-permissions

Conversation

@prasad-rtc
Copy link
Contributor

PR checklist

TaskId: (https://github.com/SkappHQ/skapp/issues/[id])

Summary

How to test

Project Checklist

  • Changes build without any errors
  • Have written adequate test cases
  • Done developer testing in
    • Chrome
    • Firefox
    • Safari
  • Code is formatted with npm run format
  • Code is linted with npm run check-lint
  • No unnecessary comments left in code
  • Made corresponding changes to the documentation

Other

  • New atomic components added
  • New molecules added
  • New pages(routes) added
  • New dependencies installed

PR Checklist

  • Pull request is raised from the correct source branch
  • Pull request is raised to the correct destination branch
  • Pull request is raised with correct title
  • Pull request is self reviewed
  • Pull request is self assigned
  • Suitable pull request status labels are added (ready-for-code-review)

Additional Information

Removes feature flag restrictions to allow people admins to access and edit employee documents in the directory UI. Facilitates document management for authorized users.
Allows document editing only for super admins or people admins who are also e-sign senders, improving access control and aligning permissions with organizational requirements.
Copilot AI review requested due to automatic review settings February 13, 2026 04:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables the “Documents” section in the People edit flow and conditionally exposes a “Documents” step in the directory stepper based on admin/e-sign sender permissions.

Changes:

  • Enabled EditPeopleFormTypes.documents to render IndividualEmployeeDocumentView in PeopleFormSections.
  • Added role-based visibility for the “Documents” step in DirectorySteppers using isSuperAdmin / isPeopleAdmin + isESignSender.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
frontend/src/community/people/components/organisms/PeopleFormSections/PeopleFormSections.tsx Adds rendering for the “Documents” edit section.
frontend/src/community/people/components/molecules/DirectorySteppers/DirectorySteppers.tsx Adds permission-based inclusion of the “Documents” step in the stepper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

: []),
// Feature flagged
// ...(isPeopleAdmin ? [translateText(["editAllInfo", "documents"])] : [])
...(isSuperAdmin || (isPeopleAdmin && isESignSender)
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The new "documents" step can be rendered even when isIndividualView or isAccountView is true. Those views render PeopleIndividualSection / PeopleAccountSection, which don't handle EditPeopleFormTypes.documents, so clicking the step will set currentStep to "Documents" and the content area will render nothing. Consider gating the documents step the same way as other edit-only steps (e.g., require !isIndividualView && !isAccountView), or add documents support to those sections if it should be available there.

Suggested change
...(isSuperAdmin || (isPeopleAdmin && isESignSender)
...(!isIndividualView &&
!isAccountView &&
(isSuperAdmin || (isPeopleAdmin && isESignSender))

Copilot uses AI. Check for mistakes.
Comment on lines 102 to 104
...(isSuperAdmin || (isPeopleAdmin && isESignSender)
? [translateText(["editAllInfo", "documents"])]
: [])
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

This new permission logic for the "documents" step is not covered by the existing DirectorySteppers tests. Adding/adjusting tests for (a) when the documents step should/shouldn't appear (super admin vs people admin + eSign sender vs others) and (b) clicking it should help prevent regressions in role-based visibility.

Copilot uses AI. Check for mistakes.
Comment on lines +106 to +109
case EditPeopleFormTypes.documents:
return (
<IndividualEmployeeDocumentView selectedUser={Number(employeeId)} />
);
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

EditPeopleFormTypes.documents now renders IndividualEmployeeDocumentView unconditionally. Since currentStep is stored in a persisted zustand store, it's possible for a user without the required roles to end up on the "Documents" step (e.g., stale persisted state) even if the stepper hides it. Consider enforcing the same permission check here as in DirectorySteppers (e.g., require isSuperAdmin || (isPeopleAdmin && isESignSender)), and fallback to a safe default step or null when unauthorized.

Copilot uses AI. Check for mistakes.
Unifies conditions for displaying stepper steps and full-width layout
using a dedicated variable, improving clarity and maintainability.
Ensures step visibility and layout are consistent across views.
@prasad-rtc prasad-rtc force-pushed the feat/42-admins-envelope-permissions branch from b767299 to f26360b Compare February 13, 2026 13:29
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant