Did I find the right examples for you? yes no

All Samples(12)  |  Call(8)  |  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
 
 
 
        update_permissions_group(permissions, obj)
 
try:

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
 
 
 
        update_permissions_group(permissions, obj)
 
try:

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
 
        group = Group.objects.create(name='test_group')
        add_user_to_group(user, group)
        update_permissions_group([perm], group)
        self.assertEqual(GroupPermissionList.objects.count(), 1)
        gl = GroupPermissionList.objects.all()[0]
 
        add_user_to_group(user, group1)
        update_permissions_group([perm1], group1)
        user = User.objects.get(username='test')
        self.assertEqual(user.has_perm('auth.test'), True)
        self.assertEqual(user.has_perm('auth.test1'), True)
 
        update_permissions_group([], group1)

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
 
        group = Group.objects.create(name='test_group')
        add_user_to_group(user, group)
        update_permissions_group([perm], group)
        self.assertEqual(GroupPermissionList.objects.count(), 1)
        gl = GroupPermissionList.objects.all()[0]
 
        add_user_to_group(user, group1)
        update_permissions_group([perm1], group1)
        user = User.objects.get(username='test')
        self.assertEqual(user.has_perm('auth.test'), True)
        self.assertEqual(user.has_perm('auth.test1'), True)
 
        update_permissions_group([], group1)