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

refactor: Move Group update from responder to services (DEV-3292) #3194

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

mpro7
Copy link
Contributor

@mpro7 mpro7 commented Apr 16, 2024

Pull Request Checklist

Task Description/Number

Issue Number: DEV-

PR Type

  • build/chore: maintenance tasks (no production code change)
  • docs: documentation changes (no production code change)
  • feat: represents new features
  • fix: represents bug fixes
  • perf: performance improvements
  • refactor: represents production code refactoring
  • test: adding or refactoring tests (no production code change)
  • deprecated: Deprecation warning (ideally referencing a migration guide)

Basic requirements for bug fixes and features

  • Tests for the changes have been added
  • Docs have been added / updated

Does this PR introduce a breaking change?

  • Yes

Does this PR change client-test-data?

  • Yes

Copy link

linear bot commented Apr 16, 2024

@mpro7 mpro7 self-assigned this Apr 16, 2024
@mpro7 mpro7 marked this pull request as ready for review April 16, 2024 15:35
Copy link
Contributor

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

.when(List(request.name, request.descriptions, request.status, request.selfjoin).flatten.isEmpty)
groupToUpdate <- groupService
.findById(iri)
.someOrFail(NotFoundException(s"Group <${iri.value}> not found."))
_ <- auth.ensureSystemAdminOrProjectAdminOfGroup(user, iri)
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: I think the authorisation check should be done first.

Copy link
Contributor Author

@mpro7 mpro7 Apr 17, 2024

Choose a reason for hiding this comment

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

When it is like that, in the test return 'NotFound' if a not-existing group IRI is submitted during update I'm getting ForbiddenException instead of expected NotFoundException. Not sure why...
I will change it in follow-up PR if this is necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

You could provide a user in the test which is actually allowed.

@mpro7 mpro7 merged commit 682f5b6 into main Apr 17, 2024
11 checks passed
@mpro7 mpro7 deleted the dev-3292-5 branch April 17, 2024 07:42
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.

4 participants