# How to Use the SAS Java Authorization Services Interface

standard usage

- Example 1: Obtaining the AuthorizationUtilInterface
- Example 2: Getting the IdentityInterface List for permissions set on an object
- Example 3: Getting the PermissionInfoInterface List for a single identity
- Example 4: Getting the AuthorizationInfoInterface List for multiple identities
- Example 5: Setting the PermissionInfoInterface List for a single identity
- Example 6: Setting the AuthorizationInfoInterface List for multiple identities

## Example 4: Getting the AuthorizationInfoInterface List for multiple identities

This is an example of getting the List of AuthorizationInfoInterface instances for more than one Identity object. Note that the return value differs from the single Identity usage in Example 3. Because AuthorizationUtilInterface.getAuthorizations() will return Permission Info for multiple Identities, it is necessary to encapsulate the PermissionInfoInterface List for each returned Identity. AuthorizationInfoInterface does exactly that.

         try
         {
            MetadataInterface object;  // any Services-level MetadataInterface object type will work here (your code must fill this in)
            AuthorizationUtilInterface authUtil = object.getAuthorizationUtil();
            List <IdentityInterface>identities; // A List of Identity objects (probably from the List returned by Example 2.)
            List <String>permissions = null; // Indicate to get all applicable Permissions for the object
            List <AuthorizationInfoInterface>authInfoList = authUtil.getAuthorizations(identities, permissions);
         }
         catch (ServiceException e)
         {
            e.printStackTrace();
         }
         catch (RemoteException e)
         {
            e.printStackTrace();
         }