Skip to content

Respect abilities return by the access api #872

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

Closed
lunika opened this issue Apr 15, 2025 · 0 comments · Fixed by #900
Closed

Respect abilities return by the access api #872

lunika opened this issue Apr 15, 2025 · 0 comments · Fixed by #900
Assignees
Labels
bug Something isn't working frontend

Comments

@lunika
Copy link
Member

lunika commented Apr 15, 2025

Bug Report

Problematic behavior

The access API endpoint returns for each user the abilities, means the current user actions available for the targeted user. The front application does not respect these abilities and implements its own business logic leading to an inconsistent behavior between the front and the back application. This can be consider as a security risk as it is possible to change the roles bypassing the front application and using directly the API.

Expected behavior/code

The front application should build the roles select box and delete button based on the abilities present in the response of the access endpoint

Steps to Reproduce

  1. Create a new document
  2. Invite someone as an owner
  3. Try to downgrade the role to administrator, the select box warn you is it not possible
  4. Inspect the response of the access endpoint, in the abilities.set_to_role you have all the roles this user can be changed to.

Environment

  • Impress version: v3.1.0

Possible Solution

Use the abilities return by the API.

@lunika lunika added bug Something isn't working frontend labels Apr 15, 2025
@AntoLC AntoLC self-assigned this Apr 22, 2025
@AntoLC AntoLC linked a pull request Apr 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants