Documentation ¶
Overview ¶
Package role ...
Package role ...
Package role ...
Package role ...
Package role ...
Index ¶
- func CheckWhitespace(fl validator.FieldLevel) bool
- func Create(ctx context.Context, req *roleproto.RoleRequest, session *asmodel.Session) response.RPC
- func Delete(ctx context.Context, req *roleproto.DeleteRoleRequest) *response.RPC
- func GetAllRoles(ctx context.Context, session *asmodel.Session) response.RPC
- func GetRole(ctx context.Context, req *roleproto.GetRoleRequest, session *asmodel.Session) response.RPC
- func Update(ctx context.Context, req *roleproto.UpdateRoleRequest, ...) response.RPC
- type Status
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 ¶
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 GetAllRoles ¶
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 ¶
func Update(ctx context.Context, req *roleproto.UpdateRoleRequest, session *asmodel.Session) response.RPC
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.