mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-04 11:32:28 +00:00
feat: auth-roles, image-gallery, click-to-open (#166)
* schema changes * db generate * db migration * add role based middleware * implement attachment token access * generate docs * implement role based auth * replace attachment specific tokens with gen token * run linter * cleanup temporary token implementation
This commit is contained in:
parent
974d6914a2
commit
de419dc37d
48 changed files with 3127 additions and 244 deletions
|
@ -22,6 +22,19 @@ func (f AttachmentFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value,
|
|||
return f(ctx, mv)
|
||||
}
|
||||
|
||||
// The AuthRolesFunc type is an adapter to allow the use of ordinary
|
||||
// function as AuthRoles mutator.
|
||||
type AuthRolesFunc func(context.Context, *ent.AuthRolesMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f AuthRolesFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
mv, ok := m.(*ent.AuthRolesMutation)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.AuthRolesMutation", m)
|
||||
}
|
||||
return f(ctx, mv)
|
||||
}
|
||||
|
||||
// The AuthTokensFunc type is an adapter to allow the use of ordinary
|
||||
// function as AuthTokens mutator.
|
||||
type AuthTokensFunc func(context.Context, *ent.AuthTokensMutation) (ent.Value, error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue