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

request to change permission insertion format in setRights() for folders #59

Open
marco76mk opened this issue Nov 18, 2023 · 0 comments

Comments

@marco76mk
Copy link

marco76mk commented Nov 18, 2023

Hello,
I suggest a change in the zimbra-api/soap-api/src/Mail/Struct/ActionGrantSelector.php file for the setRights() function.

From this:

       foreach (explode(',', $rights) as $right) {
            if (ActionGrantRight::tryFrom($right) && !in_array($right, $validRights)) {
                $validRights[] = $right;
            }
        }
        $this->rights = implode(',', $validRights);

A this:

        foreach (str_split($rights) as $right) {
            if (ActionGrantRight::tryFrom($right) && !in_array($right, $validRights)) {
                $validRights[] = $right;
            }
        }
        $this->rights = implode('', $validRights);

with this change we can pass permissions in the "natural" way they are used on zimbra bees.

for example with bees in zimbra you have to enter the permissions like this "rwixd"
while here we must separate the permissions by comma "r,w,i,x,d"
Is there a particular reason why it was chosen to use comma separated parameters?

If we do a get permission they are returned to us without a comma. Wouldn't it be better if the entry in setRights() was also without the comma? They can still be validated as suggested in the modification I proposed.
Or am I doing something wrong?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant