permissions

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceAccessControlRuleSet added in v1.22.0

func ResourceAccessControlRuleSet() common.Resource

func ResourcePermissions

func ResourcePermissions() common.Resource

ResourcePermissions definition

Types

type AccessControl

type AccessControl struct {
	UserName             string       `json:"user_name,omitempty"`
	GroupName            string       `json:"group_name,omitempty"`
	ServicePrincipalName string       `json:"service_principal_name,omitempty"`
	AllPermissions       []Permission `json:"all_permissions,omitempty"`

	// SQLA entities don't use the `all_permissions` nesting, but rather a simple
	// top level string with the permission level when retrieving permissions.
	PermissionLevel string `json:"permission_level,omitempty"`
}

AccessControl is a structure to describe user/group permissions

func (AccessControl) String

func (ac AccessControl) String() string

type AccessControlChange

type AccessControlChange struct {
	UserName             string `json:"user_name,omitempty"`
	GroupName            string `json:"group_name,omitempty"`
	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	PermissionLevel      string `json:"permission_level"`
}

AccessControlChange is API wrapper for changing permissions

func (AccessControlChange) String

func (acc AccessControlChange) String() string

type AccessControlChangeList

type AccessControlChangeList struct {
	AccessControlList []AccessControlChange `json:"access_control_list"`
}

AccessControlChangeList is wrapper around ACL changes for REST API

type ObjectACL

type ObjectACL struct {
	ObjectID          string          `json:"object_id,omitempty"`
	ObjectType        string          `json:"object_type,omitempty"`
	AccessControlList []AccessControl `json:"access_control_list"`
}

ObjectACL is a structure to generically describe access control

func (*ObjectACL) ToPermissionsEntity

func (oa *ObjectACL) ToPermissionsEntity(d *schema.ResourceData, me string) (PermissionsEntity, error)

type Permission

type Permission struct {
	PermissionLevel     string   `json:"permission_level"`
	Inherited           bool     `json:"inherited,omitempty"`
	InheritedFromObject []string `json:"inherited_from_object,omitempty"`
}

Permission is a structure to describe permission level

func (Permission) String

func (p Permission) String() string

type PermissionsAPI

type PermissionsAPI struct {
	// contains filtered or unexported fields
}

PermissionsAPI exposes general permission related methods

func NewPermissionsAPI

func NewPermissionsAPI(ctx context.Context, m any) PermissionsAPI

NewPermissionsAPI creates PermissionsAPI instance from provider meta

func (PermissionsAPI) Delete

func (a PermissionsAPI) Delete(objectID string) error

Delete gracefully removes permissions. Technically, it's using method named SetOrDelete, but here we do more

func (PermissionsAPI) Read

func (a PermissionsAPI) Read(objectID string) (objectACL ObjectACL, err error)

Read gets all relevant permissions for the object, including inherited ones

func (PermissionsAPI) Update

func (a PermissionsAPI) Update(objectID string, objectACL AccessControlChangeList) error

Update updates object permissions. Technically, it's using method named SetOrDelete, but here we do more

type PermissionsEntity

type PermissionsEntity struct {
	ObjectType        string                `json:"object_type,omitempty" tf:"computed"`
	AccessControlList []AccessControlChange `json:"access_control" tf:"slice_set"`
}

PermissionsEntity is the one used for resource metadata

Jump to

Keyboard shortcuts

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