Skip to content

Roshini Seelamsetty : Add permissions logic for task extension count visibility#5199

Open
roshini1212 wants to merge 1 commit into
developmentfrom
Roshini_feature/task-extension-count-permission
Open

Roshini Seelamsetty : Add permissions logic for task extension count visibility#5199
roshini1212 wants to merge 1 commit into
developmentfrom
Roshini_feature/task-extension-count-permission

Conversation

@roshini1212
Copy link
Copy Markdown
Contributor

@roshini1212 roshini1212 commented Apr 25, 2026

Description

Screenshot 2026-04-25 at 12 00 03

Related PRS (if any):

This frontend PR is related to the # 2181 backend PR: OneCommunityGlobal/HGNRest#2181

Main changes explained:

  • Update task UI to conditionally render deadlineCount based on user permission
  • Add seeNumberOfTimesTimeAdded permission check before displaying extension count in Edit Task view

How to test:

  1. Check into current frontend branch
  2. Run npm start
  3. Clear site data/cache
  4. Log in as Admin
  5. Go to Dashboard → Tasks → Edit any task
  6. Verify the "# of Times Time Added to Task" field is visible for Admin/Owner
  7. Log in as a user without the permission and verify the field is hidden

Screenshots or videos of changes:

Screenshot 2026-04-25 at 11 26 50 Screenshot 2026-04-25 at 11 27 18 Screenshot 2026-04-25 at 12 21 34

Note:

Requires the backend PR #2181 to be checked out for full end-to-end testing: OneCommunityGlobal/HGNRest#2181

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 25, 2026

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 43cd74e
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69ecea44f7116b0008035ff6
😎 Deploy Preview https://deploy-preview-5199--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud
Copy link
Copy Markdown

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label May 2, 2026
Copy link
Copy Markdown
Contributor

@nathanah nathanah left a comment

Choose a reason for hiding this comment

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

Just needs a small change to remove the redundant role check.

Comment on lines +151 to +153
const isAllowedToSeeDeadlineCount =
rolesAllowedToSeeDeadlineCount.includes(userRole) ||
dispatch(hasPermission('seeNumberOfTimesTimeAdded'));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const isAllowedToSeeDeadlineCount =
rolesAllowedToSeeDeadlineCount.includes(userRole) ||
dispatch(hasPermission('seeNumberOfTimesTimeAdded'));
const isAllowedToSeeDeadlineCount = dispatch(hasPermission('seeNumberOfTimesTimeAdded'));

hasPermission() checks role permissions, which it looks like you set up on the backend through createInitialPermissions.js. Checking against this hard-coded array can potentially create conflicting sources of truth.

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

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants