big ole refactor
This commit is contained in:
@@ -90,7 +90,7 @@ func (c *Checker) RequireActualAdmin(s *hws.Server) func(http.Handler) http.Hand
|
||||
|
||||
// Check user's ACTUAL role in database, bypassing preview mode
|
||||
var hasAdmin bool
|
||||
if ok := db.WithReadTx(s, w, r, c.conn, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
if ok := c.conn.WithReadTx(s, w, r, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
var err error
|
||||
hasAdmin, err = user.HasRole(ctx, tx, roles.Admin)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user