Skip to content

fix: admin access only entities are not listing for owner users - #2020

Merged
cre8ivejp merged 4 commits into
mainfrom
fix-create-account
Jul 24, 2025
Merged

fix: admin access only entities are not listing for owner users#2020
cre8ivejp merged 4 commits into
mainfrom
fix-create-account

Conversation

@cre8ivejp

@cre8ivejp cre8ivejp commented Jul 23, 2025

Copy link
Copy Markdown
Member

Fix #2023 #2024 #2025

Things done

  • Fixed the issue not listing all accounts when the current user is the owner
  • Fixed list environments, API keys, subscriptions, and Slack notifications not showing to an owner user
  • Fixed unexpected affected rows when creating accounts

Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
@cre8ivejp cre8ivejp changed the title fix: account unexpected affected rows when creating accounts fix: admin access only entities are not listing for owner users Jul 23, 2025
@cre8ivejp
cre8ivejp requested a review from Copilot July 23, 2025 14:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses access control issues for organization owner users who were incorrectly being restricted from viewing entities that should be accessible to them as admin-level users. The changes ensure that organization owners have the same access privileges as organization admins.

  • Modified role-based access control logic to properly handle organization owner permissions
  • Fixed environment filtering logic across multiple services to include owner users alongside admin users
  • Corrected account creation flow to handle existing account updates without duplicate event publishing

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/tag/api/api.go Updated environment filtering to grant owners same access as admins
pkg/push/api/api.go Updated environment filtering to grant owners same access as admins
pkg/notification/api/subscription.go Updated environment filtering with improved comment clarity
pkg/account/domain/account.go Extended admin role check to include organization owners
pkg/account/api/api_key.go Updated environment filtering to grant owners same access as admins
pkg/account/api/admin_account.go Extended admin privilege checks to include organization owners
pkg/account/api/account_test.go Removed duplicate publisher mock expectation
pkg/account/api/account.go Fixed event publishing flow and extended admin checks to include owners

Comment thread pkg/account/api/account.go Outdated
Comment thread pkg/notification/api/subscription.go Outdated
@cre8ivejp
cre8ivejp force-pushed the fix-create-account branch from 2946bb6 to eef18cd Compare July 23, 2025 14:57
@cre8ivejp
cre8ivejp requested a review from kakcy July 23, 2025 14:57
@cre8ivejp
cre8ivejp force-pushed the fix-create-account branch from eef18cd to 52828dc Compare July 23, 2025 15:00
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
@cre8ivejp
cre8ivejp force-pushed the fix-create-account branch from 52828dc to 358bd1b Compare July 23, 2025 15:02
@cre8ivejp
cre8ivejp marked this pull request as ready for review July 24, 2025 01:47
@cre8ivejp
cre8ivejp requested review from hvn2k1 and nnnkkk7 as code owners July 24, 2025 01:47
hvn2k1
hvn2k1 previously approved these changes Jul 24, 2025

@hvn2k1 hvn2k1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
@cre8ivejp
cre8ivejp force-pushed the fix-create-account branch from df18ec8 to a82362e Compare July 24, 2025 03:48

@Ubisoft-potato Ubisoft-potato left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! 👍

@nnnkkk7 nnnkkk7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@cre8ivejp
cre8ivejp merged commit 8037b84 into main Jul 24, 2025
11 checks passed
@cre8ivejp
cre8ivejp deleted the fix-create-account branch July 24, 2025 06:46
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.

fix: unexpected affected rows when creating accounts

5 participants