-
Notifications
You must be signed in to change notification settings - Fork 2
feat: per-sponsor member permission tracking with JSON column on Sponsor_User #523
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
Changes from all commits
7e11d50
788e00f
4391757
4cda54a
04376d4
a3459ad
fad5464
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,13 +60,23 @@ public function handle(SponsorServicesMQJob $job): void | |
| Log::debug("UpdateSponsorMemberGroupsMQJob::handle payload {$json}"); | ||
|
|
||
| $data = $payload['data']; | ||
| if (!isset($data['user_external_id'], $data['group_slug'], $data['sponsor_id'], $data['summit_id'])) { | ||
| throw new ValidationException('Invalid payload: user_external_id, group_slug, sponsor_id and summit_id are required.'); | ||
| } | ||
|
Comment on lines
62
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add check for Line 62 accesses Proposed fix- $data = $payload['data'];
- if (!isset($data['user_external_id'], $data['group_slug'], $data['sponsor_id'], $data['summit_id'])) {
+ if (!isset($payload['data'])) {
+ throw new ValidationException('Invalid payload: data is required.');
+ }
+ $data = $payload['data'];
+ if (!isset($data['user_external_id'], $data['group_slug'], $data['sponsor_id'], $data['summit_id'])) {🤖 Prompt for AI Agents |
||
|
|
||
| $user_external_id = intval($data['user_external_id']); | ||
| $group_slug = $data['group_slug']; | ||
| $sponsor_id = intval($data['sponsor_id']); | ||
|
romanetar marked this conversation as resolved.
|
||
| $summit_id = intval($data['summit_id']); | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| if ($user_external_id <= 0 || $sponsor_id <= 0 || $summit_id <= 0 || trim((string)$group_slug) === '') { | ||
| throw new ValidationException('Invalid payload: identifiers must be positive and group_slug must be non-empty.'); | ||
| } | ||
|
|
||
| if ($event_type === EventTypes::AUTH_USER_ADDED_TO_GROUP) { | ||
| $this->service->addSponsorUserToGroup($user_external_id, $group_slug); | ||
| $this->service->addSponsorUserToGroup($user_external_id, $group_slug, $sponsor_id, $summit_id); | ||
| } else if ($event_type === EventTypes::AUTH_USER_REMOVED_FROM_GROUP) { | ||
| $this->service->removeSponsorUserFromGroup($user_external_id, $group_slug); | ||
| $this->service->removeSponsorUserFromGroup($user_external_id, $group_slug, $sponsor_id, $summit_id); | ||
| } | ||
| $job->delete(); | ||
| } catch (\Exception $ex) { | ||
|
|
@@ -83,4 +93,4 @@ public function failed(array $data, Throwable $exception): void | |
| { | ||
| Log::error("UpdateSponsorMemberGroupsMQJob::failed {$exception->getMessage()}"); | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.