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

unify access resource check in a service #1310

Merged
merged 68 commits into from Dec 21, 2023
Merged

Conversation

syjer
Copy link
Member

@syjer syjer commented Dec 20, 2023

This will be even more simplified in a future release.

@syjer syjer requested a review from cbellone December 20, 2023 09:19
@syjer syjer changed the title unify access resourcecheck in a service unify access resource check in a service Dec 20, 2023
WaitingQueueSubscription.Status currentStatus) {
Principal principal, WaitingQueueSubscription.Status newStatus,
WaitingQueueSubscription.Status currentStatus) {
accessService.checkWaitingQueueSubscriberInEvent(subscriberId, eventName);
Copy link
Member

Choose a reason for hiding this comment

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

we should probably embed "checkEventOwnership" inside "checkWaitingQueueSubscriberInEvent", to avoid unnecessary calls

@@ -145,6 +155,7 @@ public boolean revertCheckIn(@PathVariable("eventId") int eventId,
public ResponseEntity<Boolean> revertCheckIn(@PathVariable("eventName") String eventName,
@PathVariable("ticketIdentifier") String ticketIdentifier,
Principal principal) {
accessService.checkEventTicketIdentifierMembership(principal, eventName, ticketIdentifier, AccessService.CHECKIN_ROLES);
Copy link
Member

Choose a reason for hiding this comment

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

checkEventTicketIdentifierMembership could return an EventAndOrganizationId, so that we can reduce the number of queries

validateIdList(ids);
return checkInManager.getAttendeesInformation(eventId, ids, principal.getName());
}

@GetMapping("/check-in/{eventName}/label-layout")
public ResponseEntity<LabelLayout> getLabelLayoutForEvent(@PathVariable("eventName") String eventName, Principal principal) {
accessService.canAccessEvent(principal, eventName);
Copy link
Member

Choose a reason for hiding this comment

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

canAccessEvent returns a result of type "EventAndOrganizationId". We can use that

Copy link

sonarcloud bot commented Dec 21, 2023

Quality Gate Failed Quality Gate failed

Failed conditions

33.0% Coverage on New Code (required ≥ 50%)

See analysis details on SonarCloud

@cbellone cbellone merged commit a51bd03 into 2.0-M4-maintenance Dec 21, 2023
10 of 11 checks passed
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.

None yet

2 participants