Skip to content
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”, 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

Fix/allow users to view their own application status #2080

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Achintya-Chatterjee
Copy link
Member

@Achintya-Chatterjee Achintya-Chatterjee commented Aug 19, 2024

Date: 19th August, 2024

Developer Name: @Achintya-Chatterjee


Issue Ticket Number

Description

This PR updates the backend authorization logic for accessing user intro data

  • Users can now view their own application status without requiring superuser privileges.
  • Superusers can still access the intro data of any user.
  • Proper handling of unauthorized access with a 403 status code.
  • Maintains the existing 404 response if no data is found.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1

Test Coverage

Screenshot 1

Additional Notes

@Achintya-Chatterjee Achintya-Chatterjee self-assigned this Aug 19, 2024
@Achintya-Chatterjee Achintya-Chatterjee changed the title Fix/allow users to view their own application status data Fix/allow users to view their own application status Aug 19, 2024
routes/users.js Dismissed Show dismissed Hide dismissed
@@ -33,7 +33,7 @@ router.patch(
users.updateDiscordUserNickname
);
router.get("/:username", users.getUser);
router.get("/:userId/intro", authenticate, authorizeRoles([SUPERUSER]), users.getUserIntro);
Copy link
Member

Choose a reason for hiding this comment

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

Why this?

As we already have application route why you can't fetch with it

Copy link
Member Author

@Achintya-Chatterjee Achintya-Chatterjee Aug 20, 2024

Choose a reason for hiding this comment

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

Have to change many code in website-www, to use this application route. Also new user's could only see their application status in the /intro route only.

Copy link
Member

Choose a reason for hiding this comment

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

But this is not the good solution
And ask with Ankush or Tejas is your PR is going to merge or my

Copy link
Member Author

@Achintya-Chatterjee Achintya-Chatterjee Aug 20, 2024

Choose a reason for hiding this comment

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

Only superusers would be able to accept new user request, no one else, also if you're not the applicants you will always get you are not authorised to view this. Also for your information this a temporary fix, will reverse this after all the new applicants get's onboarded into RDS discord server

How are you telling that it's not a good solution

Copy link
Member

Choose a reason for hiding this comment

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

But there is already route present for view the application then what is the need of this new route?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't build this from the ground up, it was there, just did some modifications, also previously told you that if I wanted to use the application route , will have to change many code.

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.

Refine Authorization Logic for User Intro Data Access
2 participants