none
Restrict Sequential Workflow Approval

    Question

  • Hi,

    I have a visual webpart and a sequential workflow created in VS 2010.

    In the visual webpart, I have a few textbox and a user field. In the visual webpart, the user opens the page, fills the textbox, provides his Manager id in the user field and submits form. The workflow is trigerred and email is send to manager and the user who submitted the request.

    I would like to restrict the user from approving his own request. The user has access to the Task list and has contribute level permission.

    Is it possible to restrict the user, who raised the request from approving his own request?

    Thanks

    Wednesday, July 10, 2013 8:32 AM

All replies

  • Hi,

    Yes, this is possible, you have to set special permission to the task and allow only the user to whom the task is assigned to edit it.. please check the link below , it may help you !

    http://www.sharepointkings.com/2012/11/special-permissions-in-workflow-create.html

    Regards,

    Soumya Rao

    Please mark this post as answer, if it has helped you !

    Wednesday, July 10, 2013 12:18 PM
  • Hi,

    Thanks for the reply.

    The post was helpful. I have a custom group called "Grp Admins", in which I have some members. Is it possible to provide access to the members of the group and the approver as well for the task.

    How to achieve that?

    Thanks

    Wednesday, July 10, 2013 1:30 PM
  • Hi,

    Yes i had a similar requirement, so i gave the 'GrpAdmins' group ='Full Control' permissions and then in the workflow, created task with special permissions so that only the assigned person and administrators can edit. 'GrpAdmins' members will have full control, so they will also be able to edit the task.

    Regards,

    Soumya Rao

    Thursday, July 11, 2013 5:04 AM
  • HI,

    Could you share the code block for the same. I am able to give permission to the requestor, but not sure how to give the group also permission.

    The approver might not be part of the custom group. So I want to give access to the approver as well as members of the custom group.

    Thanks


    • Edited by Venkatzeus Thursday, July 11, 2013 12:00 PM added more info
    Thursday, July 11, 2013 11:38 AM
  • Hi,

    Please find the sample code below :

    SPRoleAssignment roleAssignment = new SPRoleAssignment(oWebsite.SiteGroups[groupName]); roleAssignment.RoleDefinitionBindings.Add(oWebsite.RoleDefinitions[permissionLevel]); oWebsite.RoleAssignments.Add(roleAssignment); //change 'permissionLevel' to 'Full Control' and give your group name

    Regards,

    Soumya Rao

    Thursday, July 11, 2013 12:31 PM
  • Hi,

    Should the above code be used in createTask method?

    Thanks

    Thursday, July 11, 2013 1:25 PM
  • Hi,

    No not necessarily, you could use it anywhere in your webpart. This code just shows how to give admin permissions to a sharepoint group through code, and you could do this even through the sharepoint user interface without code. Depends on your functionality !

    Regards,

    Soumya Rao

    Friday, July 12, 2013 9:54 AM
  • HI,

    Thanks for the reply.

    But then it will not apply to the Task list and would apply to the custom list which triggerred the workflow.

    Friday, July 12, 2013 12:40 PM