Was this helpful?
Group Permissions
The methods listed on this page allow ACL operations for the group 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.
setGroupPermission
Set access permission of group to user.
Parameters
 
Name
Type
Description
Required?
id
Long
ID of the group.
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:setGroupPermission>
         <id>193</id>
         <user>171</user>
         <permission>READ</permission>
         <sessionId>03a5790a-715c-4c60-9272-803b2b7feb62</sessionId>
      </v1:setGroupPermission>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:setGroupPermissionResponse 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 = 193;
final long user = 171;
final String permission = "READ";
final String sessionId = "03a5790a-715c-4c60-9272-803b2b7feb62";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
stub.setGroupPermission(id, user, permission, sessionId);
getGroupACL
List the access permissions attached to group.
Parameters
 
Name
Type
Description
Required?
id
Long
ID of the group.
Yes.
sessionId
String
ID of the current user session.
Yes.
Returns
 
Name
Type
Description
ACLPermisssions
ACLProxy
List of ACL entries attached to the group.
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:getGroupACL>
         <id>193</id>
         <sessionId>03a5790a-715c-4c60-9272-803b2b7feb62</sessionId>
         </v1:getGroupACL>
      </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:getGroupACLResponse 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:getGroupACLResponse>
   </S:Body>
</S:Envelope>
Java Code Sample
final long id = 193;
final String sessionId = "03a5790a-715c-4c60-9272-803b2b7feb62";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
String groupValue[][] = stub.getGroupACL(id, sessionId);
hasAccessToGroup
Check whether a group has a specified access permission.
Parameters
 
Name
Type
Description
Required?
verb
Action
Access permission to check.
Yes.
id
Long
ID of the group.
Yes.
sessionId
String
ID of the current user session.
Yes.
Returns
 
Name
Type
Description
Permission State
Boolean
Returns true if the group 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:hasAccessToGroup>
         <verb>READ</verb>
         <id>193</id>
         <sessionId>03a5790a-715c-4c60-9272-803b2b7feb62</sessionId>
      </v1:hasAccessToGroup>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:hasAccessToGroupResponse xmlns:ns2="http://datacloud2.pervasive.com/schema/api/acl/v1/" xmlns:ns3="http://datasolutions.pervasive.com/api/crud">
         <return>true</return>
      </ns2:hasAccessToGroupResponse>
   </S:Body>
</S:Envelope>
Java Code Sample
final String verb = "READ";
final long id = 193;
final String sessionId = "03a5790a-715c-4c60-9272-803b2b7feb62";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
Boolean groupAccess = stub.hasAccessToGroup(Action.fromString(verb), id, sessionId);
clearGroupPermission
Clear a specified group access permission from a specified user.
Parameters
 
Name
Type
Description
Required?
id
Long
ID of the group.
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:clearGroupPermission>
         <id>193</id>
         <user>171</user>
         <permission>READ</permission>
         <sessionId>03a5790a-715c-4c60-9272-803b2b7feb62</sessionId>
      </v1:clearGroupPermission>
   </soapenv:Body>
</soapenv:Envelope>
SOAP Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:clearGroupPermissionResponse 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 = 193;
final long user = 171;
final String permission = "READ";
final String sessionId = "03a5790a-715c-4c60-9272-803b2b7feb62";
ACLServiceServiceLocator service = new ACLServiceServiceLocator();
ACLService stub = service.getACLServicePort();
stub.clearGroupPermission(id, user, permission, sessionId);
Last modified date: 12/17/2021