-
Notifications
You must be signed in to change notification settings - Fork 18
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
webapi/src/main/scala/org/knora/webapi/slice/admin/domain/service/KnoraGroupService.scala
Show resolved
Hide resolved
.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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Pull Request Checklist
Task Description/Number
Issue Number: DEV-
PR Type
Basic requirements for bug fixes and features
Does this PR introduce a breaking change?
Does this PR change client-test-data?