public IHttpActionResult GetAllDocuments([FromUri] string user_email) { if (IsTokenValid() && authenticationService.IsAllowedToGetAllDocuments(GetTokenUserEmail(), user_email)) { try { IEnumerable <Document> documents = documentManagementService.GetAllByUser(user_email); return(Ok(BaseDocument.ToModel(documents))); } catch (MissingUserException e) { BadRequest(e.Message); } catch (Exceptions e) { return(BadRequest(e.Message)); } } return(Unauthorized()); }