zava
Elite Observer

Workflow State Permission

Jump to solution

Hi,

does anybody know a way to remove edit permission to a Group in a Workflow State.

For example a Editor send a Element on Propose and after this he can't edit the Element.

Other Groups likes Admin/ChefEditors can edit the Element and run the next step to the release.

Any idea?

PS: I'm trying to remove the permission via script, at the moment without success Smiley Happy

1 Solution

Accepted Solutions
zava
Elite Observer

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);

  }

View solution in original post

0 Kudos
6 Replies
broszeit
I'm new here

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 Kudos

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 Kudos

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

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.

Screen shot 2013-02-13 at 10.24.35 .jpg

0 Kudos
zava
Elite Observer

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 Kudos

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

Peter