inventory_view.py 650 B

1234567891011121314151617
  1. import View.view_privilege as view_privilege
  2. from utility.privilege_manager import *
  3. inventory_read_only_role = Privilege_Role(name="read_only")
  4. inventory_admin_role = Privilege_Role(name="admin")
  5. def init():
  6. view_privilege.manager.create_domain(name="inventory",description="privilege domain for inventory")
  7. inventory_privilege_domain = view_privilege.manager.get_domain_by_name("inventory")
  8. inventory_privilege_domain.add_role(inventory_read_only_role)
  9. inventory_privilege_domain.add_role(inventory_admin_role)
  10. inventory_privilege_domain.include_role(inventory_admin_role,inventory_read_only_role)