Inherited Role in CRM 2011 using SDK RRS feed

  • Question

  • Hi,

       I wanted to know if it is possible to validate if a role is inherited using the SDK for MS Dynamics CRM 2011 on-prem.



    Wednesday, June 20, 2012 10:09 PM

All replies

  • Hello Tayyab,

    Yes, you can but in indirect way. You should retrieve role with parentrootroleid attribute. In case this attribute will be equal to null - this role is root otherwise it is inherited.

    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

    • Proposed as answer by MubasherSharif Thursday, June 21, 2012 6:35 AM
    Wednesday, June 20, 2012 10:13 PM
  • This is not quite right. 'parentrootroleid' is never null. roles at the root level will have roleid = parentrootroleid, but WILL have 'parentroleid' = null.

    So you have to check parentroleid to see if it is inherited, not parentrootroleid.

    ParentRootRoleId is useful when your custom web resource needs to see if a user has a given privilege, because the roleprivilege links between role/privilege are ONLY returned from the ROOT role. you can just check to see if the role in 'parentrootroleid' has the privilege in all cases (root or otherwise)

    I suspect Andrii meant to type parentroleid , not parentrootroleid.

    Thursday, January 24, 2013 4:45 PM