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

Commit

Permalink
use ID not UID when fetching service account permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
IevaVasiljeva committed Nov 7, 2023
1 parent b041ab2 commit 3abeed2
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit 3abeed2

Please sign in to comment.