Documentation ¶
Index ¶
- type Provider
- func (h *Provider) AddRole(c echo.Context) error
- func (h *Provider) AttachRole(c echo.Context) error
- func (h *Provider) DeleteRole(c echo.Context) error
- func (h *Provider) DetachRole(c echo.Context) error
- func (h *Provider) GetAllRoles(c echo.Context) error
- func (h *Provider) GetRoleAttachedUsers(c echo.Context) error
- func (h *Provider) GetUserAttachedRoles(c echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider represents the RBAC provider.
func (*Provider) AddRole ¶
AddRole adds an RBAC role using the RBAC service. @Summary Adds an RBAC role. @Description Adds an RBAC role using the RBAC service. @Tags rbac @Accept plain @Produce plain @Security ApiKeyAuth @Param role query string true "Name of the role" @Success 200 {string} string "Role created successfully." @Failure 400 {string} string "Must provide role." @Failure 500 {string} string "An error occurred while adding the role." @Router /rbac/roles/{role} [put]
func (*Provider) AttachRole ¶
AttachRole attaches a role to a user. @Summary Attach role to user. @Description Attach role to user. @Tags rbac @Accept plain @Produce plain @Security ApiKeyAuth @Param role query string true "The role" @Param username query string true "The username of the user" @Success 200 {string} string "Role attached successfully." @Failure 400 {string} string "Must provide role or username." @Failure 500 {string} string "An error occurred while attaching the role." @Router /rbac/roles/{role}/attach/{username} [put]
func (*Provider) DeleteRole ¶
DeleteRole deletes an RBAC role using the RBAC service. @Summary Delete an RBAC role. @Description Deletes an RBAC role using the RBAC service. @Tags rbac @Accept plain @Produce plain @Param role query string true "The name of the rule" @Success 200 {string} string "Role deleted successfully." @Failure 400 {string} string "Must provide role." @Failure 500 {string} string "An error occurred while deleting the role." @Router /rbac/roles/{role} [delete]
func (*Provider) DetachRole ¶
DetachRole detaches a role from a user. @Summary Detach role to user. @Description Detach role to user. @Tags rbac @Accept plain @Produce plain @Security ApiKeyAuth @Param role query string true "The role" @Param username query string true "The username of the user" @Success 200 {string} string "Role detached successfully." @Failure 400 {string} string "Must provide role or username." @Failure 500 {string} string "An error occurred while detaching the role." @Router /rbac/roles/{role}/attach/{username} [delete]
func (*Provider) GetAllRoles ¶
GetAllRoles gets all RBAC roles. @Summary Gets all RBAC roles. @Description Gets all RBAC roles. @Tags rbac @Produce plain @Security ApiKeyAuth @Success 200 {array} string "All the roles." @Router /rbac/roles [get]
func (*Provider) GetRoleAttachedUsers ¶ added in v0.2.7
GetRoleAttachedUsers gets a user attached to a role. @Summary Gets a user attached to a role. @Description Gets a user attached to a role. @Tags rbac @Accept plain @Produce json @Param role query string true "The role for the user" @Success 200 {array} string "Attached users for the role" @Failure 400 {string} string "Must provide role." @Failure 500 {string} string "An error occurred while getting the user." @Router /rbac/roles/{role}/attached [get]
func (*Provider) GetUserAttachedRoles ¶
GetUserAttachedRoles gets all roles for a user. @Summary Gets all roles for a user. @Description Gets all roles for a user. @Tags rbac @Accept plain @Produce json @Security ApiKeyAuth @Param username query string true "The username of the user" @Success 200 {array} string "Attached roles to a user" @Failure 400 {string} string "Must provide username." @Failure 500 {string} string "An error occurred while getting the roles." @Router /users/{username}/rbac/roles [get]