More in this section

Forums / Developing with Sitefinity / How to work with workflow menu programmatically?

How to work with workflow menu programmatically?

2 posts, 0 answered
  1. Anton Mernov
    Anton Mernov avatar
    110 posts
    03 Dec 2008
    12 Feb 2009
    Link to this post

    How I can to hide Approve and Decline buttons from workflow menu if current user don't have this permissions?
    I have next simple code to detect user permissions:

    CmsManager cmsManager = new CmsManager(); 
    PagePermission pagePerm = new PagePermission(cmsManager.GetRootPage(), PageRights.Approve); 
    if (pagePerm.CheckDemand()) 
    //do something 

    But I don't known how programmatically wok with workflow menu.

    Best regards,
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    13 Feb 2009
    Link to this post
    Hi Anton,

    You could try working with ~/Sitefinity/Admin/ControlTemplates/Pages/PageViewer.ascx by creating a code behind. Then add OnPreRender method and there check whether the user has permissions or not. If not you can set the control below with id="workflow" as hidden.

    <cc1:PageWorkflowMenu runat="server" id="workflow" Sufix="or"></cc1:PageWorkflowMenu> 

    I hope this helps.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered