Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
AuthRegistrarAccessQuery Class Reference

Auth Registrar Access Query to a OSF Auth Registrar Access web service endpoint. More...

Inheritance diagram for AuthRegistrarAccessQuery:

Public Member Functions

 __construct ($network, $appID, $apiKey, $userID)
 Constructor. More...
 
 create ($group, $datasetUri, $crudPermission, $webservicesUris)
 Create a new access permissions record. More...
 
 deleteTarget ($group, $datasetUri)
 Delete a target access permissions record for a specific IP address and a specific dataset. More...
 
 deleteSpecific ($accessRecordUri)
 Delete a specific access record. More...
 
 deleteAllDatasets ($datasetUri)
 Delete all accesses permissions records for a specific dataset. More...
 
 deleteAllGroups ($groupUri)
 Delete all accesses permissions records for a specific group. More...
 
 update ($accessRecordUri, $group, $datasetUri, $crudPermission, $webservicesUris)
 Create a new access permissions record. More...
 

Detailed Description

Auth Registrar Access Query to a OSF Auth Registrar Access web service endpoint.

The Auth Registrar: Access Web service is used to register (create, update and delete) an access for a given IP address, to a specific dataset and all the registered Web services endpoints registered to the WSF (Web Services Framework) with given CRUD (Create, Read, Update and Delete) permissions in the WSF.

This Web service is intended to be used by content management systems, developers or administrators to manage access to WSF (Web Service Framework) resources (users, datasets, Web services endpoints).

This web service endpoint is used to create what we refer to as an access permissions record. This record describe the CRUD permissions, for a certain IP address, to use a set of web service endpoints, to query a target dataset.

If the IP address that is registered is "0.0.0.0", it refers to the public access of this dataset. This means that if we define an access permission record for the IP address 0.0.0.0, to the CRUD permissions "Create: False; Read: True; Update: False; Delete: False", on the dataset URI http://mydomain.com/wsf/datasets/mydataset/ for all web service endpoints, this mean that anybody that send a query, to any web service endpoint, for that dataset, will be granted Read permissions. This means that this dataset becomes World Readable.

Here is a code example of how this class can be used by developers:

use \StructuredDynamics\osf\framework\Namespaces;
use \StructuredDynamics\osf\php\api\ws\auth\registrar\access\AuthRegistrarAccessQuery;
use \StructuredDynamics\osf\php\api\ws\auth\lister\AuthListerQuery;
use \StructuredDynamics\osf\php\api\framework\CRUDPermission;
// Get all the web services registered on this instance with a
// Create the AuthListerQuery object
$authlister = new AuthListerQuery("http://localhost/ws/");
// Specifies that we want to get all the list of all registered web service endpoints.
$authlister->getRegisteredWebServiceEndpointsUri();
// Send the auth lister query to the endpoint
$authlister->send();
// Get back the resultset returned by the endpoint
$resultset = $authlister->getResultset()->getResultset();
$webservices = array();
// Get all the URIs from the resultset array
foreach($resultset["unspecified"] as $list)
{
foreach($list[Namespaces::$rdf."li"] as $item)
{
array_push($webservices, $item["uri"]);
}
}
unset($authlister);
// Create a new Access record
$ara = new AuthRegistrarAccessQuery("http://localhost/ws/");
$ara->create("192.168.0.1", "http://localhost/ws/dataset/my-new-dataset-3/", new CRUDPermission(TRUE, TRUE, TRUE, TRUE), $webservices);
$ara->send();
if($ara->isSuccessful())
{
// Now, let's make sure that the record access is properly created.'
// Create the AuthListerQuery object
$authlister = new AuthListerQuery("http://localhost/ws/");
// Specifies that we want to get all the list of all registered web service endpoints.
$authlister->getDatasetGroupsAccesses("http://localhost/ws/dataset/my-new-dataset-3/");
// Send the auth lister query to the endpoint
$authlister->send();
// Get back the resultset returned by the endpoint
$resultset = $authlister->getResultset();
print_r($resultset);
}
else
{
echo "Access record creation failed: ".$ara->getStatus()." (".$ara->getStatusMessage().")\n";
echo $ara->getStatusMessageDescription();
}
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Access
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 108 of file AuthRegistrarAccessQuery.php.

Constructor & Destructor Documentation

__construct (   $network,
  $appID,
  $apiKey,
  $userID 
)

Constructor.

Parameters
mixed$networkOSF network where to send this query. Ex: http://localhost/ws/
mixed$appIDThe Application ID of the instance instance to key. The APP-ID is related to the API-KEY
mixed$apiKeyThe API Key of the OSF web service endpoints
mixed$userIDThe ID of the user that is doing the query

Definition at line 118 of file AuthRegistrarAccessQuery.php.

Member Function Documentation

create (   $group,
  $datasetUri,
  $crudPermission,
  $webservicesUris 
)

Create a new access permissions record.

Parameters
mixed$groupTarget Group URI related to the acces record being created
mixed$datasetUriSpecifies which dataset URI is targeted by the access record.
mixed$crudPermissionA CRUDPermission object instance that define the permissions granted for the target IP, target Dataset and target Web Service Endpoints of this access permission record.
mixed$webservicesUrisSpecifies which web service endpoint URI are targetted by this access record. Only the web service endpoints URIs that will be defined in this access record will be able to access/use data for the user and dataset defined in this access record. Note: you can get the complete list of webservice endpoint URIs registered to a OSF network instance by using the AuthListerQuery class and by using the getWebServicesList() function.
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Access#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 163 of file AuthRegistrarAccessQuery.php.

deleteAllDatasets (   $datasetUri)

Delete all accesses permissions records for a specific dataset.

Parameters
mixed$datasetUriDataset URI for which we delete all the access record defined for it
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Access#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 230 of file AuthRegistrarAccessQuery.php.

deleteAllGroups (   $groupUri)

Delete all accesses permissions records for a specific group.

Parameters
mixed$groupUriGroup URI for which we delete all the access record defined for it
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Access#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 248 of file AuthRegistrarAccessQuery.php.

deleteSpecific (   $accessRecordUri)

Delete a specific access record.

Parameters
mixed$accessRecordUriURI of the access record to deleten from the system
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Access#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 212 of file AuthRegistrarAccessQuery.php.

deleteTarget (   $group,
  $datasetUri 
)

Delete a target access permissions record for a specific IP address and a specific dataset.

Parameters
mixed$groupTarget Group URI related to the acces record being created
mixed$datasetUriDataset URI defined for the access record to delete
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Access#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 191 of file AuthRegistrarAccessQuery.php.

update (   $accessRecordUri,
  $group,
  $datasetUri,
  $crudPermission,
  $webservicesUris 
)

Create a new access permissions record.

Parameters
mixed$accessRecordUriAccess record URI to modify
mixed$groupTarget Group URI related to the acces record being created
mixed$datasetUriSpecifies which dataset URI is targeted by the access record.
mixed$crudPermissionA CRUDPermission object instance that define the permissions granted for the target IP, target Dataset and target Web Service Endpoints of this access permission record.
mixed$webservicesUrisSpecifies which web service endpoint URI are targetted by this access record. Only the web service endpoints URIs that will be defined in this access record will be able to access/use data for the user and dataset defined in this access record. Note: you can get the complete list of webservice endpoint URIs registered to a OSF network instance by using the AuthListerQuery class and by using the getWebServicesList() function.
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Access#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 277 of file AuthRegistrarAccessQuery.php.