|
@ -15,6 +15,7 @@ from corvus.service import ( |
|
|
from corvus.service.patch_service import get_patch_fields |
|
|
from corvus.service.patch_service import get_patch_fields |
|
|
from corvus.service.role_service import Role |
|
|
from corvus.service.role_service import Role |
|
|
from corvus.utility.pagination_utility import get_pagination_params |
|
|
from corvus.utility.pagination_utility import get_pagination_params |
|
|
|
|
|
from corvus.service.role_service import ROLE_LIST |
|
|
|
|
|
|
|
|
USER_BLUEPRINT = Blueprint( |
|
|
USER_BLUEPRINT = Blueprint( |
|
|
name='user', import_name=__name__, url_prefix='/user') |
|
|
name='user', import_name=__name__, url_prefix='/user') |
|
@ -114,3 +115,19 @@ def delete_user(name: str) -> APIResponse: |
|
|
return APIResponse( |
|
|
return APIResponse( |
|
|
APIMessage(True, 'Successfully Deleted'), status=200) |
|
|
APIMessage(True, 'Successfully Deleted'), status=200) |
|
|
return abort(404) |
|
|
return abort(404) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@USER_BLUEPRINT.route('/roles', methods=['GET']) |
|
|
|
|
|
@return_json |
|
|
|
|
|
@authentication_middleware.require( |
|
|
|
|
|
required_auth=Auth.TOKEN, required_role=Role.USER) |
|
|
|
|
|
def get_roles() -> APIResponse: |
|
|
|
|
|
""" |
|
|
|
|
|
List the roles available on the service |
|
|
|
|
|
|
|
|
|
|
|
:return: The list of roles |
|
|
|
|
|
""" |
|
|
|
|
|
return APIResponse( |
|
|
|
|
|
sorted({str(role.data) for role in ROLE_LIST}), |
|
|
|
|
|
status=200 |
|
|
|
|
|
) |