Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpecialUsers.super is deprecated #107

Open
icemac opened this issue Oct 8, 2020 · 3 comments
Open

SpecialUsers.super is deprecated #107

icemac opened this issue Oct 8, 2020 · 3 comments

Comments

@icemac
Copy link
Member

icemac commented Oct 8, 2020

According to the code SpecialUsers.super is deprecated.

Task: Add a deprecation warning when using it proposing its removal in AccessControl 6.

@jugmac00 jugmac00 assigned jugmac00 and unassigned jugmac00 Jul 2, 2021
@jugmac00
Copy link
Member

jugmac00 commented Jul 2, 2021

Hm, this seems to be pretty complicated.

There is __get_attr__ for modules with Python 3.7+, which we cannot use now.

I tried a couple of ways, but with no success.

I am definitely willing to buy a couple of beers for the one providing a working solution at the next in person sprint.

@icemac
Copy link
Member Author

icemac commented Jul 2, 2021

@jugmac00 We have zope.deprecation, see https://zopedeprecation.readthedocs.io/en/latest/api.html#deprecating-objects-inside-a-module.

So zope.deprecation.deprecated(super, 'super is deprecated, ... blah') should do the trick. (untested 😉)

@jugmac00
Copy link
Member

jugmac00 commented Jul 2, 2021

SuperUsers.super is a module level constant in AccessControl.SuperUsers, but SuperUsers.super is monkeypatched in AccessControl.users as following 🤯

SpecialUsers.super = emergency_user

I experimented also with turning SuperUsers into a class, but there are some serious circular imports going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants