locked
How to restrict user to run workflow ? RRS feed

  • Question

  • Hi all ,

    Yes we can restrict user to run workflow by taking Execute Workflow Job role from his role action.

    It will not show "Run Workflow " button in his profile .

    My scenario is that he should see "Run Workflow" button and see all assigned workflow but unable to execute workflow as he should not have that rights.What changes I have to do for this on workflow on user role ?

    Please suggest me any solution.

    Thanks & Regards

    Anand Wani  

    Monday, October 25, 2010 12:27 PM

Answers

  • If user will see the workflow than he will be able to execute it also. Most probably you should not share the workflow with the users who should not be executing it.


    MS CRM MVP :: uMar Khan :: Microsoft CRM Consultant (Blog :: http://umarkhan.wordpress.com)
    Monday, October 25, 2010 1:36 PM
    Moderator

All replies

  • If user will see the workflow than he will be able to execute it also. Most probably you should not share the workflow with the users who should not be executing it.


    MS CRM MVP :: uMar Khan :: Microsoft CRM Consultant (Blog :: http://umarkhan.wordpress.com)
    Monday, October 25, 2010 1:36 PM
    Moderator
  • Hello, Anand.

    You can try to do following (but this is unsupported trick) - but this is only theory - I haven't checked that it would work:

    1. Activate ExecuteWorkflow message for handling using following SQL Query against CRM DB:

    Update
        SdkMessageFilter
    Set IsCustomProcessingStepAllowed = 1
    Where
        SdkMessageId in
    (
        Select
            SdkMessageId
        From
            SdkMessage
        Where
            Name = 'ExecuteWorkflow')

    2. Make iisreset.

    3. Develop plugin which will handle ExecuteWorkflow message in pre mode, check that user is allowed to run workflow and in the case that he has no rights - just raise exception.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    • Proposed as answer by Faisal Fiaz Monday, October 25, 2010 3:26 PM
    Monday, October 25, 2010 2:29 PM
    Moderator
  • You can also specify in the workflow that if the user is A, B or C, just cancel workflow otherwise run it.

    Regards

    Faisal

    Monday, October 25, 2010 3:28 PM
  • Following up on uMar's recommendation: for users who should be restricted, make their "Read" access to the Workflow entity available only in "User" scope.  That will effectively limit their ability to see (and run) Workflows that aren't owned by them.  Using the "Sharing" model, you can provide access to specific Workflows to which they should have access.  This is the easiest way to limit access without complicated development.
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Friday, November 5, 2010 8:18 PM
    Moderator