refac: DELETE /v1/user/{id}?expected_role_id=N, user.remove audit event, 409 target_role_not_found, GetAll returns its error, Own-scope visibility filter moved into repos, JSON tags removed from use-case types
This commit is contained in:
1 parent
5d6f378fce
commit
b39a41be88
124 files changed
+8816
-523
No files matched your search
@@ -105,6 +105,7 @@ const (
|
||||
ActionUserUpdateProfile = "user.update_profile"
|
||||
ActionUserChangeRole = "user.change_role"
|
||||
ActionUserTransferOwnership = "user.transfer_ownership"
|
||||
ActionUserRemove = "user.remove"
|
||||
ActionInviteCreate = "invite.create"
|
||||
ActionInviteCancel = "invite.cancel"
|
||||
ActionInviteRenew = "invite.renew"
|
||||
@@ -135,6 +136,7 @@ const (
|
||||
ParamRemoved = "removed"
|
||||
ParamFrom = "from"
|
||||
ParamTo = "to"
|
||||
ParamToName = "to_name"
|
||||
ParamMaxGBFrom = "max_gb_from"
|
||||
ParamMaxGBTo = "max_gb_to"
|
||||
ParamMerged = "merged"
|
||||
|
||||
@@ -16,18 +16,19 @@ var (
|
||||
|
||||
ErrMissingPermission = errors.New("missing permission")
|
||||
|
||||
ErrRoleHasMembers = errors.New("role still has members")
|
||||
ErrRoleNameTaken = errors.New("role name already used")
|
||||
ErrRoleLocked = errors.New("role is locked")
|
||||
ErrBuiltInRole = errors.New("role is built in")
|
||||
ErrBuiltInName = errors.New("built-in role cannot be renamed")
|
||||
ErrOwnRole = errors.New("cannot change the role you hold")
|
||||
ErrInvalidRoleName = errors.New("invalid role name")
|
||||
ErrUnknownContentType = errors.New("unknown content type")
|
||||
ErrNotBuiltIn = errors.New("role is not built in")
|
||||
ErrInvalidReassign = errors.New("invalid reassign target")
|
||||
ErrEscalation = errors.New("grants more than the caller holds")
|
||||
ErrUnknownRole = errors.New("unknown role")
|
||||
ErrRoleHasMembers = errors.New("role still has members")
|
||||
ErrRoleNameTaken = errors.New("role name already used")
|
||||
ErrRoleLocked = errors.New("role is locked")
|
||||
ErrBuiltInRole = errors.New("role is built in")
|
||||
ErrBuiltInName = errors.New("built-in role cannot be renamed")
|
||||
ErrOwnRole = errors.New("cannot change the role you hold")
|
||||
ErrInvalidRoleName = errors.New("invalid role name")
|
||||
ErrUnknownContentType = errors.New("unknown content type")
|
||||
ErrNotBuiltIn = errors.New("role is not built in")
|
||||
ErrInvalidReassign = errors.New("invalid reassign target")
|
||||
ErrReassignTargetNotFound = errors.New("reassign target not found")
|
||||
ErrEscalation = errors.New("grants more than the caller holds")
|
||||
ErrUnknownRole = errors.New("unknown role")
|
||||
)
|
||||
|
||||
type Scope string
|
||||
|
||||
@@ -10,6 +10,7 @@ type Repository interface {
|
||||
FindByIDs(ids []uint32) ([]User, error)
|
||||
Create(user User) (User, error)
|
||||
Delete(id uint32) error
|
||||
DeleteIfRole(id uint32, roleID uint32) error
|
||||
UpdateVerificationStatus(userId uint32, isVerified bool) (User, error)
|
||||
UpdatePassword(userId uint32, password string) (User, error)
|
||||
UpdatePasswordResetCode(userId uint32, code string, expiration time.Time) (User, error)
|
||||
|
||||
Reference in new issue
Block a user