package auth

import "context"

type RoleRepository interface {
	CreateRole(ctx context.Context, role *Role) error
	UpdateRole(ctx context.Context, role *Role) error
	DeleteRole(ctx context.Context, id []byte) error
	GetRoleByID(ctx context.Context, id []byte) (*Role, error)
	GetRoleByName(ctx context.Context, name string) (*Role, error)
	HasRolePermission(ctx context.Context, roleID []byte, permissionKey string) (bool, error)
	GetPermissionByID(ctx context.Context, id []byte) (*Permission, error)
	GetPermissionByKey(ctx context.Context, key string) (*Permission, error)
	UpdatePermission(ctx context.Context, permission *Permission) error
	ListPermissionsByRoleID(ctx context.Context, roleID []byte) ([]Permission, error)
	ListPermissions(ctx context.Context, filter string, sort string, limit, offset int) ([]Permission, int64, error)
	AssignPermission(ctx context.Context, roleID, permissionID []byte) (*RolePermission, error)
	RemovePermission(ctx context.Context, roleID, permissionID []byte) error
	ListRoles(ctx context.Context, filterName string, sort string, limit, offset int) ([]Role, int64, error)
}
