2016-09-10 13:08:10 +00:00
|
|
|
# ~*~ coding: utf-8 ~*~
|
|
|
|
#
|
|
|
|
|
2016-09-11 08:59:19 +00:00
|
|
|
from users.utils import AdminUserRequiredMixin
|
|
|
|
from users.models import User, UserGroup
|
|
|
|
from assets.models import Asset, AssetGroup, SystemUser
|
2016-11-15 11:33:04 +00:00
|
|
|
from assets.serializers import AssetGrantedSerializer, AssetGroupSerializer
|
2016-09-10 13:08:10 +00:00
|
|
|
|
2016-11-02 16:09:38 +00:00
|
|
|
|
|
|
|
def associate_system_users_with_assets(system_users, assets, asset_groups):
|
|
|
|
for asset in assets:
|
|
|
|
asset.system_users.add(*tuple(system_users))
|
|
|
|
|
|
|
|
for asset_group in asset_groups:
|
|
|
|
asset_group.system_users.add(*tuple(system_users))
|