rbac

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	Client          *azapi.Client
	SubscriptionIDs []string
}

Driver wraps an authenticated ARM client for the Microsoft.Authorization/roleAssignments and roleDefinitions resources.

func (*Driver) Create

func (d *Driver) Create(ctx context.Context, scope, principalID, roleName string) (azapi.RoleAssignment, error)

Create binds principalID to the role identified by roleName at scope. The role name is resolved to a roleDefinition GUID via List on roleDefinitions.

func (*Driver) DefaultScope

func (d *Driver) DefaultScope() string

DefaultScope returns the canonical subscription-level scope for the first known subscription, or an empty string if no subscription is configured.

func (*Driver) Delete

func (d *Driver) Delete(ctx context.Context, scope, assignmentName, principalID, roleName string) (string, error)

Delete removes a role assignment. Either assignmentName (GUID) or the (principalID, roleName) tuple may be supplied; when principal/role are given the driver lists assignments at scope to resolve the GUID.

func (*Driver) List

func (d *Driver) List(ctx context.Context, scope, principalID string) ([]azapi.RoleAssignment, error)

List returns role assignments under the supplied scope. When principalID is non-empty it is forwarded as `$filter=principalId eq '...'`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL