Was this helpful?
Destination Permissions
The methods listed on this page allow ACL operations for the destination entity.
Note:  The following imports are required for all of the Java code examples on this page.
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import com.pervasive.datacloud2.schema.api.acl.v1.ACLService;
import com.pervasive.datacloud2.schema.api.acl.v1.ACLServicePortBindingStub;
import com.pervasive.datacloud2.schema.api.acl.v1.ACLServiceService;
import com.pervasive.datacloud2.schema.api.acl.v1.ACLServiceServiceLocator;
import com.pervasive.datacloud2.schema.api.acl.v1.InvalidSessionException;
import com.pervasive.datacloud2.schema.api.acl.v1.Action;
Tip...  Use the Entity API Service login method to start a session and obtain the sessionId parameter required for the ACL Service API methods. See Login and Logout.
setDestinationPermission
Set access to a specified destination for a designated user.
Parameters
 
Name
Type
Description
id
Long
ID of the destination.
user
Long
ID of the user.
permission
String
Permission to set.
sessionId
String
ID of the current user session.
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://datacloud2.pervasive.com/schema/api/acl/v1/">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:setDestinationPermission>
         <id>73</id>
         <user>171</user>
         <permission>READ</permission>
         <sessionId>75b18137-fec2-4f34-b985-fdfb5152e474</sessionId>
      </v1:setDestinationPermission>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:setDestinationPermissionResponse xmlns:ns2="http://datacloud2.pervasive.com/schema/api/acl/v1/" xmlns:ns3="http://datasolutions.pervasive.com/api/crud"/>
   </S:Body>
</S:Envelope>
Java Code Sample
//Method Signature:
public void setDestinationPermission(Long id, Long user, String permission, String sessionId)
throws com.pervasive.datasolutions.datacloud.exceptions.InvalidSessionException

//Usage:
public class Destination {
   public static void main(String args[]) throws InvalidSessionException, ServiceException {
      long userId = 171;
      long destinationId = 73;
      ACLServiceServiceLocator service = new ACLServiceServiceLocator();
      ACLService stub = service.getACLServicePort();
         try {
            stub.setDestinationPermission(destinationId, userId, "READ","75b18137-fec2-4f34-b985-fdfb5152e474");
         }
         catch (RemoteException e) {
            e.printStackTrace();
         }
   }
}
getDestinationACL
List the access permissions attached to a specified destination.
Parameters
 
Name
Type
Description
id
Long
ID of the destination.
sessionId
String
ID of the current user session.
Returns
 
Name
Type
Description
ACLPermisssions
ACLProxy
List of ACL entries attached to the specified destination.
Errors
 
Name
InvalidSessionException
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://datacloud2.pervasive.com/schema/api/acl/v1/">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:getDestinationACL>
         <id>73</id>
         <sessionId>75b18137-fec2-4f34-b985-fdfb5152e474</sessionId>
      </v1:getDestinationACL>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:getDestinationACLResponse xmlns:ns2="http://datacloud2.pervasive.com/schema/api/acl/v1/" xmlns:ns3="http://datasolutions.pervasive.com/api/crud">
         <return>
            <ns2:entry user="171">
               <ns2:permission>READ</ns2:permission>
            </ns2:entry>
         </return>
      </ns2:getDestinationACLResponse>
   </S:Body>
</S:Envelope>
Java Code Sample
//Method Signature:
public ACLProxy getDestinationACL (Long id, String sessionId)
throws com.pervasive.datasolutions.datacloud.exceptions.InvalidSessionException

//Usage:
public class Destination {
   public static void main(String args[]) throws InvalidSessionException, ServiceException
{
      long destinationId = 73;
      ACLServiceServiceLocator service = new ACLServiceServiceLocator();
      ACLService stub = service.getACLServicePort();
      try {
         String destinationValue[][] = stub.getDestinationACL(destinationId,"75b18137-fec2-4f34-b985-fdfb5152e474");
          }
      catch (RemoteException e) {
         e.printStackTrace();
      }
   }
}
hasAccessToDestination
Checks whether a specified destination has the designated access permissions assigned to it.
Parameters
 
Name
Type
Description
verb
Action
Access permission to check.
id
Long
ID of the destination.
sessionId
String
ID of the current user session.
Returns
 
Name
Type
Description
Permission State
Boolean
Returns true if the destination has specified permission.
Errors
 
Name
InvalidSessionException
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://datacloud2.pervasive.com/schema/api/acl/v1/">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:hasAccessToDestination>
         <verb>READ</verb>
         <destinationId>73</destinationId>
         <sessionId>75b18137-fec2-4f34-b985-fdfb5152e474</sessionId>
      </v1:hasAccessToDestination>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:hasAccessToDestinationResponse xmlns:ns2="http://datacloud2.pervasive.com/schema/api/acl/v1/" xmlns:ns3="http://datasolutions.pervasive.com/api/crud">
         <return>true</return>
      </ns2:hasAccessToDestinationResponse>
   </S:Body>
</S:Envelope>
Java Code Sample
//Method Signature:
public boolean hasAccessToDestination (com.pervasive.datasolutions.datacloud.acl.Action verb, Long id, String sessionId)
throws com.pervasive.datasolutions.datacloud.exceptions.InvalidSessionException

//Usage:
public class Destination {
   public static void main(String args[]) throws InvalidSessionException, ServiceException
{
      long userId = 171;
      long destinationId = 73;
      ACLServiceServiceLocator service = new ACLServiceServiceLocator();
      ACLService stub = service.getACLServicePort();
      try {
         Boolean destinationAccess = stub.hasAccessToDestination(Action.fromString("READ"), destinationId, "75b18137-fec2-4f34-b985-fdfb5152e474");
      }
         catch (RemoteException e) {
            e.printStackTrace();
      }
   }
}
clearDestinationPermission
Clears access permissions from a specified destination for a designated user.
Parameters
 
Name
Type
Description
id
Long
ID of the destination.
user
Long
ID of the user.
permission
String
Permission to clear.
sessionId
String
ID of the current user session.
Errors
 
Name
InvalidSessionException
Example
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://datacloud2.pervasive.com/schema/api/acl/v1/">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:clearDestinationPermission>
         <id>73</id>
         <user>171</user>
         <permission>READ</permission>
         <sessionId>75b18137-fec2-4f34-b985-fdfb5152e474</sessionId>
      </v1:clearDestinationPermission>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:clearDestinationPermissionResponse xmlns:ns2="http://datacloud2.pervasive.com/schema/api/acl/v1/" xmlns:ns3="http://datasolutions.pervasive.com/api/crud"/>
   </S:Body>
</S:Envelope>
Java Code Sample
//Method Signature:
public void clearDestinationPermission(Long id, Long user, String permission, String sessionId)
throws com.pervasive.datasolutions.datacloud.exceptions.InvalidSessionException

//Usage:
public class Destination {
public static void main(String args[]) throws InvalidSessionException, ServiceException
      {
      long userId = 171;
      long destinationId = 73;
      ACLServiceServiceLocator service = new ACLServiceServiceLocator();
      ACLService stub = service.getACLServicePort();
      try {
         stub.clearDestinationPermission(destinationId, userId, "READ", "75b18137-fec2-4f34-b985-fdfb5152e474");
      }
      catch (RemoteException e) {
         e.printStackTrace();
      }
   }
}
Last modified date: 12/17/2021