Versions in this module Expand all Collapse all v0 v0.0.1 Oct 25, 2021 Changes in this version + const MatchAll + const MatchWildcard + const PermissionAuthRoleCompanyRead + const PermissionAuthRoleCompanyWrite + const PermissionAuthRoleSelfRead + const PermissionAuthRoleSelfWrite + const PermissionAuthUserCompanyRead + const PermissionAuthUserCompanyWrite + const PermissionAuthUserInfoCompanyRead + const PermissionAuthUserInfoCompanyWrite + const PermissionAuthUserInfoSelfRead + const PermissionAuthUserInfoSelfWrite + const PermissionAuthUserSelfRead + const PermissionAuthUserSelfWrite + var ErrCredentialNotMatched = errors.New("credential not matched") + var ErrIncompatibleHashVersion = errors.New("incompatible hash version") + var ErrPermissionDenied = errors.New("permission denied") + var ErrUserDoesNotHaveAnyPermission = errors.New("user does not have any permission") + type Credentials struct + Hash string + SshPublicKeys []string + func NewPasswordCredentials(password string) (Credentials, error) + func (c Credentials) ValidatePassword(password string) error + type Permission = string + type Role struct + Accesses []string + Description string + ID string + Name string + func (r Role) IsAllowed(perm Permission) error + type User struct + CreatedAt time.Time + Credentials *Credentials + IsActivated bool + Roles []Role + Username string + func NewUser(username string, cred Credentials) User + func (u User) IsAllowed(perm Permission) error