Did I find the right examples for you? yes no

All Samples(10)  |  Call(6)  |  Derive(0)  |  Import(4)

src/p/e/permission-backend-nonrel-0.2/permission_backend_nonrel/admin.py   permission-backend-nonrel(Download)
 
from .models import UserPermissionList, GroupPermissionList
from .utils import update_permissions_user, \
     update_user_groups, update_permissions_group
 
                groups = []
 
            update_user_groups(obj, groups)
        except KeyError:
            pass

src/d/j/django-permission-backend-nonrel-HEAD/permission_backend_nonrel/admin.py   django-permission-backend-nonrel(Download)
 
from .models import UserPermissionList, GroupPermissionList
from .utils import update_permissions_user, \
     update_user_groups, update_permissions_group
 
                groups = []
 
            update_user_groups(obj, groups)
        except KeyError:
            pass

src/p/e/permission-backend-nonrel-0.2/permission_backend_nonrel/tests.py   permission-backend-nonrel(Download)
from .models import UserPermissionList, \
     GroupPermissionList
from .utils import add_permission_to_user, \
     add_user_to_group, add_permission_to_group, update_permissions_user, update_user_groups, update_permissions_group
 
    def test_add_user_to_group(self):
        user = User.objects.get(username='test')
        group = Group.objects.create(name='test_group')
        update_user_groups(user, [group])
        self.assertEqual(UserPermissionList.objects.count(), 1)
        self.assertEqual(user.has_perm('auth.test1'), False)
 
        update_user_groups(user, [group1])
        user = User.objects.get(username='test')
        self.assertEqual(user.has_perm('auth.test'), False)

src/d/j/django-permission-backend-nonrel-HEAD/permission_backend_nonrel/tests.py   django-permission-backend-nonrel(Download)
from .models import UserPermissionList, \
     GroupPermissionList
from .utils import add_permission_to_user, \
     add_user_to_group, add_permission_to_group, update_permissions_user, update_user_groups, update_permissions_group
 
    def test_add_user_to_group(self):
        user = User.objects.get(username='test')
        group = Group.objects.create(name='test_group')
        update_user_groups(user, [group])
        self.assertEqual(UserPermissionList.objects.count(), 1)
        self.assertEqual(user.has_perm('auth.test1'), False)
 
        update_user_groups(user, [group1])
        user = User.objects.get(username='test')
        self.assertEqual(user.has_perm('auth.test'), False)