def assert_request_user_has_permission(request, permission_type):
 has_permission = request_user_has_permission(request=request, permission_type=permission_type)
 if (not has_permission):
  user_db = get_user_db_from_request(request=request)
  raise ResourceTypeAccessDeniedError(user_db=user_db, permission_type=permission_type)

def assert_request_user_has_permission ( request , permission_type ) : has_permission = request_user_has_permission ( request = request , permission_type = permission_type ) if ( not has_permission ) : user_db = get_user_db_from_request ( request = request ) raise ResourceTypeAccessDeniedError ( user_db = user_db , permission_type = permission_type )
check that currently logged-in user has specified permission .