This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

IsCommandAvailable

Hello,

   Is there a way to access the administrator name making the request via the IsCommandAvailable so we can tailor menu options based on the administrator?

Thanks

Parents
  • Normally, the command list is dynamically built up based on the rights granted by the access template(s) that the delegated admin is a trustee for.

    Is there a reason this is not suitable for you?

  • IsCommandAvailable is used to limit the visibility of items based on other criteria, not permissions. So, for instance, we have an option to 'Suspend' a user which simply updates an attribute. So, we use IsCommandAvailable to hide this option if the attribute has already be set. This all works fine. What we are trying to do now is change the visibility of the menu items based on the administrator currently logged in. Again, this isn't permissions or access template related. IsCommandAvailable lets you easily access the directory object of the item select but we need to access the details of the administrator performing the action.

  • The $Session object has information regarding the credential used to access the session.

    The Active Roles SDK has more information, but it looks like you can access the current session using  $Security.Sessions.Current object which has a UserName property.

  • That would be PowerShell, IsCommandAvailable is vbscript with a web session.

  • You can access the object with whichever scripting language you prefer. There are both VBScript and PowerShell samples in the SDK.

Reply Children
  • Well I tried but the script refused to run:

    Set Session = Security.Sessions.Current
    ' Retrieve AdsPath of the user in which security context
    ' this session is running
    strUserAdsPath = Session.UserPath

    I don't think Security is available via VBScript in a web session. I can't find any errors anywhere though.