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
fix(appwrite): make meta.permissions
overrideable #5767
#5774
fix(appwrite): make meta.permissions
overrideable #5767
#5774
Conversation
Signed-off-by: Abdelrahman Essawy <abdelrahman.mo.essawy@gmail.com>
🦋 Changeset detectedLatest commit: df85083 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit df85083. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @abdelrahman-essawy thanks for the quick PR! Added a minor comment, let's get rid of fallback any permissions completely.
3705577
to
d39232f
Compare
…defaultWritePermissions` Signed-off-by: Abdelrahman Essawy <abdelrahman.mo.essawy@gmail.com>
@BatuhanW I did remove the fallback value, but note that test it only passes with describe("create", () => {
it("correct response with meta", async () => {
const { data } = await dataProvider(client, {
databaseId: "632455a0b8d017403ce9",
defaultWritePermissions: [Permission.write(Role.any())],
defaultReadPermissions: [Permission.read(Role.any())]
}).create({
resource: "632455a55dc72e1aa016",
variables: {
title: "Lorem",
},
});
expect(data.title).toEqual("Lorem");
expect(data.id).toBeTruthy();
});
}); |
Yeah, we need to update tests too. And also ideally re-record them with nock. |
Hey @abdelrahman-essawy, we've merged |
@BatuhanW hello, I think I don't have the permission to re-open the PR nor change the base branch. note that the base branch is still |
Hey @abdelrahman-essawy, I can't do it too 😨 Could you checkout a new branch from latest master and create a new PR then? |
Hey @abdelrahman-essawy we would like to release this one with May Release. Do you have time to re-open this PR so we can get it released? |
@BatuhanW sure thing, I will re-open it and update the tests this weekend. |
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
Users couldn't override the default
readPermissions
/writePermissions
values.What is the new behavior?
Users are able to override the default permissions by passing
options.defaultReadPermissions
/options.defaultWritePermissions
OR by passingmeta?.readPermissions
/meta?.writePermissions
.If user passed
options.defaultReadPermissions
ANDmeta?.readPermissions
, then the priority will be as following:meta?.readPermissions
if not? thenoptions.defaultReadPermissions
if not? thenRole.any()
.fixes #5767
Notes for reviewers
This should be compatible with old users who are not passing
meta?.readPermissions
and expecting to getRole.any()
by default.