3 Replies Latest reply: May 8, 2012 11:49 AM by arjun.sengupta RSS

    find roles owned by user

    w112nxs
      trying to create a rule which can give me the list of roles owned by the loggedin user.

      <invoke name='getObjectNames' class='com.waveset.ui.FormUtil'>
      <rule name='getConfiguratorSession'/>
      <s>Role</s>
      <map>
      <s>conditions</s>
      <list>
      <new class='com.waveset.object.AttributeCondition'>
      <s>authType</s>
      <s>equals</s>
      <s>BusinessRole</s>
      </new>
      <new class='com.waveset.object.AttributeCondition'>
      <s>Owners</s>
      <s>is one of</s>
      <list>
      <s>test123</s>
      </list>
      </new>
      </list>
      </map>
      </invoke>
        • 1. Re: find roles owned by user
          Bobm53-Oracle
          Hi,
          I think they should be mantained in <ref>waveset.roles</ref>.
          • 2. Re: find roles owned by user
            w112nxs
            waveset.roles gives the list of roles the user has.
            I'm looking for the roles which the user is an owner of. or an approver of.
            • 3. Re: find roles owned by user
              arjun.sengupta
              Hello,

              Need to pass the user's object id in the below method:

              <block>
              <set name='type'>
              Role </set>
              <set name='attributeName'>
              <select>
              role_owners
              </select>
              </set>
              <set name='attributeVal'>
              <s>#ID#7BF7-:8CB9FD91731:71246001:A4230228AEA8DBF8</s> ...this is the object id of the user
              </set>
              <dolist name='aRole'>
              <invoke name='toList'>
              <invoke name='listObjects'>
              <ref>:display.session</ref>
              <invoke name='findType' class='com.waveset.object.Type'>
              <ref>type</ref>
              </invoke>
              <map>
              <s>conditions</s>
              <new class='com.waveset.object.AttributeCondition'>
              <ref>attributeName</ref>
              <s>equals</s>
              <ref>attributeVal</ref>
              </new>
              </map>
              </invoke>
              </invoke>
              <get>
              <ref>aRole</ref>
              <s>name</s>
              </get>
              </dolist>
              </block>

              Code to get object id of a user------

              <invoke name='getId'>
              <invoke name='getObject'>
              <ref>:display.session</ref>
              <s>User</s>
              <ref>accountId</ref>
              <null/>
              </invoke>
              </invoke>


              use role_approvers ... to get role_approvers ... hope this helps

              Regards
              Arjun

              Edited by: arjun.sengupta on May 8, 2012 9:44 AM