Restrict Sequential Workflow Approval

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

July 10th, 2013 11:32am

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 !

Free Windows Admin Tool Kit Click here and download it now
July 10th, 2013 3:18pm

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

July 10th, 2013 4:30pm

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


Free Windows Admin Tool Kit Click here and download it now
July 11th, 2013 7:39am

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

July 11th, 2013 8:04am

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

Free Windows Admin Tool Kit Click here and download it now
July 11th, 2013 8:33am

Hi,

Should the above code be used in createTask method?

Thanks

July 11th, 2013 9:26am

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

Free Windows Admin Tool Kit Click here and download it now
July 12th, 2013 5:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics