2015-02-12 20:57:05 +01:00
|
|
|
from .models import Permission
|
2014-10-11 14:34:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
def get_protected_perm():
|
|
|
|
"""
|
|
|
|
Returns the permission to manage users. This function is a helper
|
|
|
|
function used to protect manager users from locking out themselves.
|
|
|
|
"""
|
2015-01-22 18:29:12 +01:00
|
|
|
return Permission.objects.get_by_natural_key(
|
|
|
|
app_label='users', model='user', codename='can_manage')
|