Credential Permissions
The methods listed on this page allow ACL operations for the credential 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.
setCredentialPermission
Set access permission of a specified credential entity for a designated user.
Parameters
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:setCredentialPermission>
<id>2958423</id>
<user>171</user>
<permission>READ</permission>
<sessionId>75b18137-fec2-4f34-b985-fdfb5152e474</sessionId>
</v1:setCredentialPermission>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:setCredentialPermissionResponse 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 long id = 2958423;
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.setCredentialPermission(id, user, permission, sessionId);
getCredentialACL
List the access permissions attached to credential.
Parameters
Returns
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:getCredentialACL>
<id>2958423</id>
<sessionId>34f1befe-a322-411f-aa68-e8f10c22c750</sessionId>
</v1:getCredentialACL>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:getCredentialACLResponse 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:getCredentialACLResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final long id = 2958423;
final String sessionId = "70c84502-e6d2-4c4b-b3a9-a74c6f8a5ff9";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
String credentialValue[][] = stub.getCredentialACL(id, sessionId);
hasAccessToCredential
Check whether a specified credential entity has the designated permissions.
Parameters
Returns
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:hasAccessToCredential>
<verb>READ</verb>
<credentialId>2958423</credentialId>
<sessionId>75b18137-fec2-4f34-b985-fdfb5152e474</sessionId>
</v1:hasAccessToCredential>
</soapenv:Body>
</soapenv:Envelope>
SAOP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:hasAccessToCredentialResponse xmlns:ns2="http://datacloud2.pervasive.com/schema/api/acl/v1/" xmlns:ns3="http://datasolutions.pervasive.com/api/crud">
<return>true</return>
</ns2:hasAccessToCredentialResponse>
</S:Body>
</S:Envelope>
Java Code Sample
final String verb = "READ";
final long id = 2958423;
final String sessionId = "70c84502-e6d2-4c4b-b3a9-a74c6f8a5ff9";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
Boolean credentialAccess = stub.hasAccessToCredential(Action.fromString(verb), id, sessionId);
clearCredentialPermission
Clear permission from a specified credential entity for a designated user.
Parameters
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:clearCredentialPermission>
<id>2958423</id>
<user>171</user>
<permission>READ</permission>
<sessionId>75b18137-fec2-4f34-b985-fdfb5152e474</sessionId>
</v1:clearCredentialPermission>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:clearCredentialPermissionResponse 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 long id = 2958423;
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.clearCredentialPermission(credentialId, userId, "READ","75b18137-fec2-4f34-b985-fdfb5152e474");
Last modified date: 12/17/2021