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

🚀 Feature: "Query" Database by permissions #5169

Open
2 tasks done
nimos-dev opened this issue Feb 27, 2023 · 2 comments
Open
2 tasks done

🚀 Feature: "Query" Database by permissions #5169

nimos-dev opened this issue Feb 27, 2023 · 2 comments
Labels
product / databases Fixes and upgrades for the Appwrite Database.

Comments

@nimos-dev
Copy link

🔖 Feature description

Extend the functionality of: Database List Documents (get a list of all the user's documents in a given collection.)

Suggestions:

List Documents(X) Get a list of all the user's documents in a given collection where user has permissions X;

List Documents(Read) (Get a list of all the user's documents which the user has read permissions)
List Documents(Read/Write) (Get a list of all the user's documents which the user has read/write permissions)
List Documents(Read/Write/Delete) ( Get a list of all the user's documents which the user has read/write/Delete permissions)

🎤 Pitch

Today we can List Documents (get a list of all the user's documents in a given collection.) which in practice means all documents to which the user has read rights. It would be nice if you could get all documents based on what permissions the user have. Today you have to implement extra redundant attributes if we want to sort/querry by permission.

Examples of areas of use are content moderation.

Not a critical feature but something that would help avoid boilerplate code and redundant attributes which improves code quality and reduces the risk of errors. Today, when I give a user write rights, I have to both update permissions and then also an attribute field to be able to sort/querry based on whether the user has write permissions or not.

👀 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?

@stnguyen90 stnguyen90 changed the title 🚀 Feature: "Querie" Database by permissions 🚀 Feature: "Query" Database by permissions Feb 27, 2023
@stnguyen90
Copy link
Contributor

@nimos-dev, thanks for creating this issue! 🙏🏼

@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Feb 27, 2023
@dhonig-weizmann
Copy link

upvoted :)

Is there any workaround I can use in the meantime?

I tried to use
Query.contains('\$permissions', 'read("user:$subjectId")') but I get an error Attribute not found in schema: $permissions
Using dart_appwrite version 11.0.3

Any help would be most appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

3 participants