view_privilege.py 693 B

1234567891011121314151617181920212223
  1. from asyncore import read
  2. from utility.privilege_manager import *
  3. manager = Privilege_Manager()
  4. inventory_read_only_role = Privilege_Role(name="read_only")
  5. inventory_admin_role = Privilege_Role(name="admin")
  6. def init() :
  7. manager.create_domain(name="inventory",description="privilege domain for inventory")
  8. inventory_privilege_domain = manager.get_domain_by_name("inventory")
  9. inventory_privilege_domain.add_role(inventory_read_only_role)
  10. inventory_privilege_domain.add_role(inventory_admin_role)
  11. inventory_privilege_domain.include_role(inventory_admin_role,inventory_read_only_role)
  12. def populate_manager() :
  13. None