rbac

package
v1.0.67 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 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
	Login        string
	DepartmentID *int
	DeviceId     string
	PlatformId   int
}

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