Zum Hauptinhalt gehen

Workflow State Permission

Kommentare

6 Kommentare

  • Zendesk API User
    Author: broszeit - 2/5/2013 9:48

    Hi,

    i don't understand in detail what you want to achieve.

    On which element do you want to remove the edit permissions? On the workflow itself or on the StoreElement which is in the workflow?

    Why do you use a script and what do you want the script to do?

    Probably it would be helpful if you post the code of your script.

    Regards

    Rouven

    0
  • Zendesk API User
    Author: zava - 2/11/2013 12:04

    Hi Rouven,

    I can not post the code, I will find a solution without use a script.

    we have 3 states in Page workflow, "created" "proposed" "online".

    On created the Element can be edited from a normal editor, after editing the editor send the Element on proposed.

    On proposed the normal editor can not edit the Element, the Element is not locked (WF write locked), is just not editable for a editor, but can be edit from a chef editor.

    In two words, I have to find a way to set different rights for a Element in different states.

    regards

    Antonio

    0
  • Zendesk API User
    Author: broszeit - 2/11/2013 13:24

    Hi Antonio,

    I think the best way to achieve this is to execute a script in the workflow.

    You can use the method StoreElement.setPermission() to set the Permissions.

    In your case it might be the best to change the permissions for the two differing groups.

    Just call the method with one parameter being the group and the other parameter the Permission object.

    Have a look at the API documentation to find out how you build your Permission object:

    http://www.e-spirit.com/odfs50/access/de/espirit/firstspirit/access/store/Permission.html

    Regards

    Rouven

    0
  • Zendesk API User
    Author: zava - 2/13/2013 9:27

    Hi Rouven,

    I'm trying with Api Permission and is working, I just miss the function to break the Inherit permission in a Page. If I just set the rights it doesn't work and the Editor still can edit the Page.

    0
  • Zendesk API User
    Author: zava - 2/13/2013 10:50

    I found it, I have to set all rights on defined rights, this break the inheritance, and after set the Editor rights.

      List<Principal> inheritedPermissions = se.getInheritedPrincipalPermissions();

      for( Principal group:inheritedPermissions ){

        Permission groupPermission = se.getPermission((Group) group);

        se.setPermission((Group) group, groupPermission);

      }

    0
  • Zendesk API User
    Author: Peter_Jodeleit - 2/13/2013 14:16

    Of course it does. But it's only necessary to set the permissions of the group "everyone" to achieve "break inheritence".

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.