roles

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRolesByOrgID

func GetRolesByOrgID(ctx context.ServiceContext, client *clients.GQLClient, org_id string) (*[]Role, error)

Fetches all the roles in an organisation.

Types

type Role

type Role struct {
	ID        string    `json:"id,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	Name string `json:"name"`

	OrgID string `json:"org_id,omitempty"`

	Permissions string `json:"permissions,omitempty"`
}

func Insert

func Insert(ctx context.ServiceContext, client *clients.GQLClient, options *RoleInsertOptions) (*Role, error)

Insert new permissions.

func (*Role) GetPermissions

func (o *Role) GetPermissions() (*permissionCommons.Permissions, error)

Permissions structure will also have to be manually unmarshalled. Because Hasura sends stringified JSON.

type RoleInsertOptions

type RoleInsertOptions struct {
	OrgID       string                        `json:"org_id,omitempty"`
	Name        string                        `json:"name"`
	Permissions permissionCommons.Permissions `json:"permissions,omitempty"`
}

Jump to

Keyboard shortcuts

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