Skip to content

Conversation

@ABSinhaa
Copy link
Contributor

@ABSinhaa ABSinhaa commented Nov 8, 2024

JIRA link

TD-4880

Description

Added a check for the categoryId of the admin users while fetching the self assessments, making sure we only pull the self assessments that matches the categoryId on the admin account of the user, also added an Unauthorized check when anyone tries to manipulate the self assessment delegates using the query string URL being opened.
If there's a categoryId on the admin account of the user, then show self assessments that are specific to the categoryId, if there's no categoryId on the admin account of the user, continue showing all the self assessments.

Screenshots

When categoryId is set to null on the admin account, the user can see all the self assessments and can access delegates from all the self assessments.
image

When categoryid has a value on the admin account, the user can only see the self assessments with that specific categoryID.
In the below example categoryId is set to 34 and it has only 5 assessments that have the same categoryId on them.
image

If the user tries to manipulate the URL and passess a different selfAssessmentId in the querystring parameter and that self assessment has a different categoryId on it which doesn't match with the one on the user's admin account then show an Unauthorised page.
image


Developer checks

(Leave tasks unticked if they haven't been appropriate for your ticket.)

I have:

  • Run the formatter and made sure there are no IDE errors (see info on Text Editor settings to avoid whitespace changes)
  • Written tests for the changes (accessibility tests, unit tests for controller, data services, services, view models, etc)
  • Manually tested my work with and without JavaScript
  • Tested any Views or partials created or changed with Wave Chrome plugin and addressed any valid accessibility issues
  • Updated/added documentation in Confluence and/or GitHub Readme. List of documentation links added/changed:
  • Updated my Jira ticket with information about other parts of the system that were touched as part of the MR and have to be sanity tested to ensure nothing’s broken
  • Scanned over my pull request in GitHub and addressed any warnings from the GitHub Build and Test checks.

…elf assessments in a category that doesn't match their own through URL manipulation.
…pposed to be made for Delegate Activities and not Activity Delegates, adding specific logic to the Self Assessment service layer and showing Unauthorised activity based on return type.
@ABSinhaa ABSinhaa marked this pull request as ready for review November 8, 2024 11:54
@sherif-olaboye
Copy link
Contributor

The pr look ok

Copy link
Collaborator

@Auldrin-Possa Auldrin-Possa left a comment

Choose a reason for hiding this comment

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

Looks good

@rshrirohit rshrirohit merged commit 203ad52 into DLS-Release-v1.1.0 Nov 8, 2024
2 checks passed
@rshrirohit rshrirohit deleted the Develop/fixes/TD-4880-Prevent_Admin_View_ActivityDelegates branch November 8, 2024 16:51
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.

5 participants