Skip to content

CRASM- 2829: Ensure users can't update themselves except name #983

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

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

aloftus23
Copy link
Contributor

@aloftus23 aloftus23 commented Jul 1, 2025

🗣 Description

This ticket addresses the issue with users being able to update their own user objects.

  • Ensures the PUT /v2/users/{} endpoint has correct role based permissions and users can only update specific fields like first_name and last_name
  • Write more pytests to ensure this stays locked down

💭 Motivation and context

Users should only be able to update their first_name and last_name.

🧪 Testing

Created new pytests and passes pre-commit and github checks.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.
  • Bump major, minor, patch, pre-release, and/or build versions as appropriate via the bump_version script if this repository is versioned and the changes in this PR warrant a version bump.
  • Create a pre-release (necessary if and only if the pre-release version was bumped).

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release (necessary if and only if the version was bumped).

@aloftus23 aloftus23 self-assigned this Jul 1, 2025
@DJensen94 DJensen94 marked this pull request as ready for review July 2, 2025 14:42
@aloftus23 aloftus23 marked this pull request as draft July 2, 2025 14:44
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