inventory_view.py 639 B

123456789101112131415161718
  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. inventory_privilege_domain = Privilege_Domain("inventory",description="privilege domain for inventory")
  7. view_privilege.manager.register_domain(inventory_privilege_domain)
  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)