role.py 627 B

123456789101112131415161718192021222324252627282930
  1. # -*- coding: utf-8 -*-
  2. """
  3. walle-web
  4. :copyright: © 2015-2017 walle-web.io
  5. :created time: 2017-03-25 11:15:01
  6. :author: wushuiyong@walle-web.io
  7. """
  8. from flask import request
  9. from walle.api.api import SecurityResource
  10. from walle.model.user import RoleModel
  11. class RoleAPI(SecurityResource):
  12. """
  13. 角色模型跟gitlab一样,分别是超管,空间所有者,项目管理员,开发者,访客
  14. """
  15. def get(self):
  16. """
  17. fetch role list
  18. /role/
  19. :return:
  20. """
  21. role_list, count = RoleModel.list()
  22. return self.list_json(list=role_list, count=count)