inventory_view.py 734 B

1234567891011121314151617181920
  1. from Model.isp_model import user_account
  2. import View.view_privilege as view_privilege
  3. from utility.privilege_manager import *
  4. import persistence
  5. import Model.isp_model
  6. import json
  7. inventory_read_only_role = Privilege_Role(name="read_only")
  8. inventory_admin_role = Privilege_Role(name="admin")
  9. def init():
  10. inventory_privilege_domain = Privilege_Domain("inventory",description="privilege domain for inventory")
  11. view_privilege.manager.register_domain(inventory_privilege_domain)
  12. inventory_privilege_domain.add_role(inventory_read_only_role)
  13. inventory_privilege_domain.add_role(inventory_admin_role)
  14. inventory_privilege_domain.include_role(inventory_admin_role,inventory_read_only_role)