locked
Hide Ribbon Button Based on User's Privilege on a specific Record RRS feed

  • Question

  • Is there a way to hide a custom button within a custom entity based on the user's privilege on that specific record?  Using ribbon workbench where I see I can display a button based on a user's privilege for a specific entity.  A user , in our case, may have write privileges on some records of a given entity but not others.  I want to display the button if they have write privilege on the specific record of the entity they are on.  Disable rules appear to have this ability but not display - unless I'm missing something.

    Thank you,


    Robert

    Thursday, June 12, 2014 8:37 PM

All replies

  • I believe in this case you'd have to use JScript to modify the parent css to hide the button. Unsupported, but I've done it before. If you have an enable rule for the button, add additional logic in the JScript function that hides it as well as returning false.
    Thursday, June 12, 2014 9:53 PM
  • Hello,

    Did you check this thread



    Our Website| Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Friday, June 13, 2014 5:04 AM
    Moderator
  • Hi Robert,

    I did a post on how to do this a while back - http://ribbonworkbench.uservoice.com/knowledgebase/articles/76681-hide-a-standard-out-of-the-box-button-based-on-a

    You need to use a DisplayRule with an EntityPrivilegeRule:

    <DisplayRule Id="new.contact.CanDeleteContact.DisplayRule">
    <EntityPrivilegeRule PrivilegeType="Delete" PrivilegeDepth="Global" EntityName="contact" />
    </DisplayRule>

    Hope this helps,

    Scott


    Scott Durow
    Blog www.develop1.net    Follow Me
    Rockstar365
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Sunday, June 15, 2014 1:42 PM
    Answerer
  • Thanks.

    Most if not all users in question would not have delete privileges on the entity nor assign.  They would have assign privileges but only on specific records they are associated with.  Seems odd there is no record privilege filter for display and it only exists for enabling/disabling.


    Robert

    Monday, June 16, 2014 12:49 AM