Skip to content

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

Description

@marco76mk

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions