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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Enhancement: Client: set permission scope #8085

Open
2 tasks done
minecrawler opened this issue May 7, 2024 · 0 comments
Open
2 tasks done

馃殌 Enhancement: Client: set permission scope #8085

minecrawler opened this issue May 7, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@minecrawler
Copy link

馃敄 Enhancement description

The API should be able to execute actions in the context of a (different) user's permissions. This could be implemented by adding a method to Client:

Client.setPermissionScope = (role: Role): Client => {}

馃帳 Pitch

Never trust a user. This should be the guiding factor when designing app security. Hence, it makes sense to disable services for the client. Doing so can prevent data scraping and partly hacker's interference by providing contextual, minimal APIs using Functions.

Appwrite offers a granular permissions system, which would help a lot in order to further harden security, in conjunction with locking down services and only providing minimal Function APIs. However, disabled services aren't available to Functions either when executing actions with a user session, even though they are executed in a controlled environment.

Hence, I would like a way to make use of all of a Functions amenities while also respecting permissions. E.g. it should be simple to check if a logged in user (via JWT?) has the permission to delete a document or file, and the operation should fail if not.

See this Discord discussion for context.

Further, this functionality could be useful to admins or moderators who want to see their site (e.g. a Dashboard, Forum, etc.) with different permissions applied. A switch between views could easily be implemented by just changing the permission scope and user's role from admin to user or similar.

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@minecrawler minecrawler added the enhancement New feature or request label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant