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 3: Getting the PermissionInfoInterface List for a single identity

    This is an example of getting the List of PermissionInfoInterface instances for a single IdentityInterface.

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