Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application specific: Ensure only allowed person (usually admin or file owner) i... #425

Open
github-actions bot opened this issue Sep 1, 2022 · 0 comments
Labels

Comments

@github-actions
Copy link

github-actions bot commented Sep 1, 2022

application specific: Ensure only allowed person (usually admin or file owner) is allowed to delete

// TODO application specific: Ensure only allowed person (usually admin or file owner) is allowed to delete

  ): Promise<PrivateFile> {
    return this.fileService.getPrivateFile(getPrivateFileArgs);
  }

  /**
   * Deletes a private file
   * @param {DeleteFileInput} deleteFileInput - contains UUID
   * @returns {Promise<PrivateFile>} - the file that was deleted
   */
  @LoggedIn() // TODO application specific: set appropriate guards here
  @Mutation(() => User)
  async deletePrivateFile(
    @Args('deleteFileInput')
    deleteFileInput: DeleteFileInput,
  ): Promise<PrivateFile> {
    // TODO application specific: Ensure only allowed person (usually admin or file owner) is allowed to delete
    return this.fileService.deleteFile(
      deleteFileInput,
      false,
    ) as unknown as PrivateFile;
  }

  /**
   * Deletes a public file
   * @param {DeleteFileInput} deleteFileInput - contains UUID
   * @returns {Promise<PrivateFile>} - the file that was deleted
   */
  @LoggedIn() // TODO application specific: set appropriate guards here
  @Mutation(() => User)
  async deletePublicFile(
    @Args('deleteFileInput')
    deleteFileInput: DeleteFileInput,
  ): Promise<PublicFile> {
    // TODO application specific: Ensure only allowed person (usually admin ) is allowed to delete
    return this.fileService.deleteFile(
      deleteFileInput,
      true,
    ) as unknown as PublicFile;
  }
}

d6668fa7e012f399c9446efb24d8acddbd2c93f9

@github-actions github-actions bot added the todo label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants