rbac

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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 NewProvider

func NewProvider(svc rbac.Service) *Provider

NewProvider creates a new Provider.

func (*Provider) AddRole

func (h *Provider) AddRole(c echo.Context) error

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

func (h *Provider) AttachRole(c echo.Context) error

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

func (h *Provider) DeleteRole(c echo.Context) error

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

func (h *Provider) DetachRole(c echo.Context) error

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

func (h *Provider) GetAllRoles(c echo.Context) error

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

func (h *Provider) GetRoleAttachedUsers(c echo.Context) error

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

func (h *Provider) GetUserAttachedRoles(c echo.Context) error

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]

Jump to

Keyboard shortcuts

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