Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Service accounts: use ID not UID when fetching service account permissions #169

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions service_account_permissions.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package gapi

func (c *Client) ListServiceAccountResourcePermissions(uid string) ([]*ResourcePermission, error) {
return c.listResourcePermissions(ServiceAccountsResource, ResourceUID(uid))
func (c *Client) ListServiceAccountResourcePermissions(id int64) ([]*ResourcePermission, error) {
return c.listResourcePermissions(ServiceAccountsResource, ResourceID(id))
}

func (c *Client) SetServiceAccountResourcePermissions(uid string, body SetResourcePermissionsBody) (*SetResourcePermissionsResponse, error) {
return c.setResourcePermissions(ServiceAccountsResource, ResourceUID(uid), body)
func (c *Client) SetServiceAccountResourcePermissions(id int64, body SetResourcePermissionsBody) (*SetResourcePermissionsResponse, error) {
return c.setResourcePermissions(ServiceAccountsResource, ResourceID(id), body)
}

func (c *Client) SetUserServiceAccountResourcePermissions(serviceAccountUID string, userID int64, permission string) (*SetResourcePermissionsResponse, error) {
func (c *Client) SetUserServiceAccountResourcePermissions(id int64, userID int64, permission string) (*SetResourcePermissionsResponse, error) {
return c.setResourcePermissionByAssignment(
ServiceAccountsResource,
ResourceUID(serviceAccountUID),
ResourceID(id),
UsersResource,
ResourceID(userID),
SetResourcePermissionBody{
Expand All @@ -23,10 +23,10 @@ func (c *Client) SetUserServiceAccountResourcePermissions(serviceAccountUID stri
)
}

func (c *Client) SetTeamServiceAccountResourcePermissions(serviceAccountUID string, teamID int64, permission string) (*SetResourcePermissionsResponse, error) {
func (c *Client) SetTeamServiceAccountResourcePermissions(id int64, teamID int64, permission string) (*SetResourcePermissionsResponse, error) {
return c.setResourcePermissionByAssignment(
ServiceAccountsResource,
ResourceUID(serviceAccountUID),
ResourceID(id),
TeamsResource,
ResourceID(teamID),
SetResourcePermissionBody{
Expand Down