The GetPolicyForUserSid procedure is used to retrieve a specific UserAccessPolicy for the specified User SID.

The following input parameter is used.

Param_userSid: This is of type string that specifies the User SID for which the policy needs to be retrieved.

The following is the output parameter from this procedure.

Result_accessPolicy: Of type UserAccessPolicy.

The server performs the following processing steps:

  1. Convert the given Param_userSid from string format to byte array format by System.Security.Prinicipal.SecurityIdentifier(Param_userSid).GetBinaryForm() method.

  2. Look up the row in ADM_UserAccessPolicyTable with the UserGroupSecurityIdentifierBytes value being Param_userSid.

  3. If row is not found, then return NULL. Otherwise initialize Result_accessPolicy with UserAccessPolicy.

  4. Assign Result_accessPolicy.PolicyId with PolicyId of the row.

  5. Copy the UserAccessPolicyDetails into Result_accessPolicy.

  6. Call GetPolicyMapEntriesForPolicyId procedure of ADM_PolicyMapTable with PolicyId assigned to Param_policyId as the parameter. Assign the Result_policyEntries to Result_accessPolicy.PolicyDefinition.

  7. Return Result_accessPolicy as the output of the procedure.