Was this helpful?
Product Permissions
The methods listed on this page allow ACL operations for the product 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.
setProductPermission
Set access permission for a user to a product.
Parameters
 
Name
Type
Description
Required?
id
String
ID of the product.
Yes.
user
Long
ID of the user.
Yes.
permission
String
Permission to set.
Yes.
sessionId
String
ID of the current user session.
Yes.
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:setProductPermission>
         <id>00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9</id>
         <user>171</user>
         <permission>READ</permission>
         <sessionId>70c84502-e6d2-4c4b-b3a9-a74c6f8a5ff9</sessionId>
      </v1:setProductPermission>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:setProductPermissionResponse 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
final String id = "00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9";
final long user = 171;
final String permission = "READ";
final String sessionId = "060cc0a2-ebd6-4e60-818e-1bec33053a4a";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
stub.setProductPermission(id, user, permission, sessionId);
getProductACL
List the access permissions attached to product.
Parameters
 
Name
Type
Description
Required?
id
String
ID of the product.
Yes.
sessionId
String
ID of the current user session.
Yes.
Returns
 
Name
Type
Description
ACLPermisssions
ACLProxy
List of ACL entries attached to product.
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:getProductACL>
         <id>00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9</id>
         <sessionId>70c84502-e6d2-4c4b-b3a9-a74c6f8a5ff9</sessionId>
      </v1:getProductACL>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:getProductACLResponse 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>
            <ns2:entry user="995">
               <ns2:permission>READ</ns2:permission>
            </ns2:entry>
         </return>
      </ns2:getProductACLResponse>
   </S:Body>
</S:Envelope>
Java Code Sample
final String id = "00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9";
final String sessionId = "70c84502-e6d2-4c4b-b3a9-a74c6f8a5ff9";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
String productValue[][] = stub.getProductACL(id, sessionId);
hasAccessToProduct
Checks whether a product has specific access permissions.
Parameters
 
Name
Type
Description
Required?
verb
Action
Permission to check.
Yes.
id
String
ID of the product.
Yes.
sessionId
String
ID of the current user session.
Yes.
Returns
 
Name
Type
Description
Permission State
Boolean
Returns true if the product has the specified permission.
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:hasAccessToProduct>
         <verb>READ</verb>
         <productId>00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9</productId>
         <sessionId>70c84502-e6d2-4c4b-b3a9-a74c6f8a5ff9</sessionId>
      </v1:hasAccessToProduct>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:hasAccessToProductResponse xmlns:ns2="http://datacloud2.pervasive.com/schema/api/acl/v1/" xmlns:ns3="http://datasolutions.pervasive.com/api/crud">
         <return>true</return>
      </ns2:hasAccessToProductResponse>
   </S:Body>
</S:Envelope>
Java Code Sample
final String verb = "READ";
final String id = "00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9";
final String sessionId = "70c84502-e6d2-4c4b-b3a9-a74c6f8a5ff9";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
Boolean productAccess = stub.hasAccessToProduct(Action.fromString(verb), id, sessionId);
clearProductPermission
Clears a specified product access permission for a designated user.
Parameters
 
Name
Type
Description
Required?
id
String
ID of the product.
Yes.
user
Long
ID of the user.
Yes.
permission
String
Permission to clear.
Yes.
sessionid
String
ID of the current user session.
Yes.
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:clearProductPermission>
         <id>00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9</id>
         <user>171</user>
         <permission>READ</permission>
         <sessionId>70c84502-e6d2-4c4b-b3a9-a74c6f8a5ff9</sessionId>
      </v1:clearProductPermission>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:clearProductPermissionResponse 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
final String id = "00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9";
final long user = 171;
final String permission = "READ";
final String sessionId = "70c84502-e6d2-4c4b-b3a9-a74c6f8a5ff9";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
stub.clearProductPermission(id, user, permission, sessionId);
Last modified date: 12/17/2021