Commits

Florian Hahn  committed 8436187

implement utils functions for django nonrel

  • Participants
  • Parent commits 79e95d6

Comments (0)

Files changed (1)

File object_permission_backend_nonrel/utils.py

 
 
 def get_group_id_list(user_id):
-    return []
+    from permission_backend_nonrel.models import UserPermissionList
+
+    try:
+        return UserPermissionList.objects.get(user__id=user_id).group_fk_list
+    except UserPermissionList.DoesNotExist:
+        return []
 
 def get_content_type_string(obj):
     return (obj._meta.app_label + '.' + obj.__class__.__name__).lower()
     
 
 def add_user_to_group(user, group):
-    pass
+    from permission_backend_nonrel.utils import add_user_to_group as _add_user_to_group
+    _add_user_to_group(user, group)