You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to request the addition of code folding inside the rules-file.
I believe it would be beneficial to have such functionality if you have large and/or are implementing a large amount of custom functions to help validate.
We have a case where code folding would come in handy, and be able to collapse the entire match path for a collection.
We have - for now- 3 functions within the scope of the match path of a collection, and we are unit testing our rules, so after our tests pass there's no need to focus on that section anymore and it would be beneficial to be able to collapse it down again.
match /users/{user} {
function isSelf() {
return request.auth.uid == resource.id;
}
function isAllowedToReadAnotherUser() {
let user = get(/databases/$(database)/documents/users/$(request.auth.uid));
return userHasRole(user, ["role_1", "role_2"]);
}
function isAllowedToChangeAnotherUser() {
let user = get(/databases/$(database)/documents/users/$(request.auth.uid));
return userHasRole(user, ["role_2"]);
}
allow read: if isSignedIn() && (isSelf() || isAllowedToReadAnotherUser());
allow write: if isSignedIn() && isAllowedToChangeAnotherUser();
}
the above is an example block which would have been nice to have to collapse into the following
I would like to request the addition of code folding inside the rules-file.
I believe it would be beneficial to have such functionality if you have large and/or are implementing a large amount of custom functions to help validate.
We have a case where code folding would come in handy, and be able to collapse the entire match path for a collection.
We have - for now- 3 functions within the scope of the match path of a collection, and we are unit testing our rules, so after our tests pass there's no need to focus on that section anymore and it would be beneficial to be able to collapse it down again.
the above is an example block which would have been nice to have to collapse into the following
I believe this reference should be of help. https://plugins.jetbrains.com/docs/intellij/folding-builder.html#define-a-folding-builder
The text was updated successfully, but these errors were encountered: