|
|
@ -3,6 +3,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
python ../apps/manage.py shell << EOF |
|
|
|
python ../apps/manage.py shell << EOF |
|
|
|
from perms.models import * |
|
|
|
from perms.models import * |
|
|
|
|
|
|
|
from assets.models import SystemUser |
|
|
|
|
|
|
|
|
|
|
|
for old in NodePermission.objects.all(): |
|
|
|
for old in NodePermission.objects.all(): |
|
|
|
perm = AssetPermission.objects.create( |
|
|
|
perm = AssetPermission.objects.create( |
|
|
@ -20,5 +21,10 @@ for old in NodePermission.objects.all(): |
|
|
|
perm.user_groups.add(old.user_group) |
|
|
|
perm.user_groups.add(old.user_group) |
|
|
|
perm.nodes.add(old.node) |
|
|
|
perm.nodes.add(old.node) |
|
|
|
perm.system_users.add(old.system_user) |
|
|
|
perm.system_users.add(old.system_user) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for s in SystemUser.objects.all(): |
|
|
|
|
|
|
|
nodes = list(s.nodes.all()) |
|
|
|
|
|
|
|
s.nodes.set([]) |
|
|
|
|
|
|
|
s.nodes.set(nodes) |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
|
|
|
|
|
|
|
|