kfh,
@kfh@chaos.social avatar

You're a good framework, #Django, but sometimes, SOMETIMES, I'm almost losing it.

bmispelon,
@bmispelon@mastodon.social avatar

@kfh not sure if you wanted a reply, or just to rant.

In case it was option 2, feel free to ignore this message 😁

If it was option 1, then superuser doesn't imply staff, the two are independent.

Superuser is about the permission system : user.has_perm(...) will always be True for a superuser.

kfh,
@kfh@chaos.social avatar

@bmispelon heh, mostly ranting :)

We've got an identity-aware proxy in our k8s cluster which passes user data (i.e. name, e-mail, groups) along to the Django app as request headers. These are used to get_or_create (and log in) an Employee object, which is our user model, in middleware.

is_staff will be set from is_superuser in the save() method of Employee, and I've verified that both fields are are True in the DB, but I'm still denied access...

Works well locally, outside the cluster, though

kfh,
@kfh@chaos.social avatar

@bmispelon Turns out that my user in the dev cluster evaluated is_active to False, and flipping that solved the issue :)

bmispelon,
@bmispelon@mastodon.social avatar

@kfh Ah yes, that would do it 😁

  • All
  • Subscribed
  • Moderated
  • Favorites
  • django
  • Durango
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • osvaldo12
  • khanakhh
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • everett
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • JUstTest
  • GTA5RPClips
  • cubers
  • ethstaker
  • normalnudes
  • tacticalgear
  • cisconetworking
  • tester
  • Leos
  • modclub
  • megavids
  • provamag3
  • anitta
  • lostlight
  • All magazines