role

package
v0.0.0-...-8d2fcc7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package role ...

Package role ...

Package role ...

Package role ...

Package role ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckWhitespace

func CheckWhitespace(fl validator.FieldLevel) bool

CheckWhitespace func is used to check for whitepsace insde the string given func trims the spaces from the value and then checks if it is empty

func Create

func Create(ctx context.Context, req *roleproto.RoleRequest, session *asmodel.Session) response.RPC

Create defines creation of a new role. The function is supposed to be used as part of RPC.

For creating an role, two parameters need to be passed RoleRequest and Session. New RoleID,AssignedPrivileges and OemPrivileges will be part of RoleRequest, and Session parameter will have all session related data, espically the privileges. For creating new role the ConfigureUsers privilege is mandatory.

There will be two return values for the fuction. One is the RPC response, which contains the status code, status message, headers and body and the second value is error.

func Delete

Delete defines the functionality of deletion of non predefined roles

func GetAllRoles

func GetAllRoles(ctx context.Context, session *asmodel.Session) response.RPC

GetAllRoles defines the functionality of listing of all roles.

As input parameters we need to pass Session, which contains all session data especially configureUsers privilege.

As return parameters RPC response, which contains status code, message, headers and data.

func GetRole

func GetRole(ctx context.Context, req *roleproto.GetRoleRequest, session *asmodel.Session) response.RPC

GetRole defines the viewing of a particular role which is identified by the id.

As input parameters we need to pass Session, which contains all session data especially configureUsers privilege and the roleID which is used to identify the role which is supposed to be viewed.

As return parameters RPC response, which contains status code, message, headers and data.

func Update

Update defines the updation of the role details. Every role details can be updated other than the roleID if the session parameter have sufficient privileges.

For updating an account, parameters need to be passed are RoleRequest and Session. New RoleID,AssignedPrivileges and OEMPrivileges will be part of RoleRequest, and Session parameter will have all session related data, especially the privileges.

There will be two return values for the fuction. One is the RPC response, which contains the status code, status message, headers and body.

Types

type Status

type Status struct {
	Code    int
	Message string
}

Status to handle the error code and message

Jump to

Keyboard shortcuts

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