Пример #1
0
 def get_is_admin(self, obj):
     user = self.context['request'].user
     # Check if the request user is among the first five delegates in the organisation
     return can_admin_org(obj, user)
Пример #2
0
def is_org_admin(org_id, user):
    """ Is an Admin for the given Organisation """
    return can_admin_org(Organisation.objects.get(id=org_id), user)
Пример #3
0
 def get_is_admin(self, obj):
     user = EmailUser.objects.get(id=self.context.get('user_id'))
     return can_admin_org(obj, user)