anvilistas / anvil-labs

MIT License
9 stars 3 forks source link

Support require_user and possibly Make `require_user=True` the default for `@callable`? #63

Closed hugetim closed 2 years ago

hugetim commented 2 years ago

I've recently seen it described as a best practice to require authorization by default, and that seems sensible in my (limited) experience.

So I'd propose having require_user default to True. It would then be necessary to explicitly set it to False if you don't want to require authorization. (Or you could still set it to a function to restrict permissions further.)

meatballs commented 2 years ago

The users service isn't enabled by default on an anvil app and I'd prefer our stuff to work by default on any app.

hugetim commented 2 years ago

As long as I can pass a require_user argument to the kompot version of @callable, it's easy enough to wrap it with my own function to accomplish this effect.

s-cork commented 2 years ago

We haven't yet implemented the decorator to support require user. So reopening this