Documentation ¶
Overview ¶
Package role ...
Package role ...
Package role ...
Package role ...
Package role ...
Index ¶
- func CheckWhitespace(fl validator.FieldLevel) bool
- func Create(req *roleproto.RoleRequest, session *asmodel.Session) response.RPC
- func Delete(req *roleproto.DeleteRoleRequest) *response.RPC
- func GetAllRoles(session *asmodel.Session) response.RPC
- func GetRole(req *roleproto.GetRoleRequest, session *asmodel.Session) response.RPC
- func Update(req *roleproto.UpdateRoleRequest, session *asmodel.Session) 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 Delete ¶
func Delete(req *roleproto.DeleteRoleRequest) *response.RPC
Delete defines the functionality of deletion of non predefined roles
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 ¶
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, espically 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.