rbac

package
v1.0.42 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorizedMethod = apperr.New("auth",
		apperr.WithTitleTranslate(translate.Translate{translate.RU: "Попытка авторизации"}),
		apperr.WithContext("auth"),
	)

	ErrForbiddenMethod = apperr.New("auth",
		apperr.WithTitleTranslate(translate.Translate{translate.RU: "Попытка авторизации"}),
		apperr.WithContext("auth"),
	)

	ErrErrorToGetUserFromContext = apperr.New("error_to_get_user_from_context")
)

Functions

func Can

func Can(roles ...string) func(c *gin.Context)

Types

type AuthUser

type AuthUser struct {
	ID   int
	Role string
}

func User

func User(ctx context.Context) (*AuthUser, error)

Jump to

Keyboard shortcuts

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