Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
AuthRegistrarAccessQuery.php
Go to the documentation of this file.
1 <?php
2 
5 
11 
108  class AuthRegistrarAccessQuery extends \StructuredDynamics\osf\php\api\framework\WebServiceQuery
109  {
118  function __construct($network, $appID, $apiKey, $userID)
119  {
120  // Set the OSF network & credentials to use for this query.
121  $this->setNetwork($network);
122  $this->appID = $appID;
123  $this->apiKey = $apiKey;
124  $this->userID = $userID;
125 
126  // Set default configarations for this web service query
127  $this->setSupportedMimes(array("text/xml",
128  "application/json",
129  "application/rdf+xml",
130  "application/rdf+n3",
131  "application/iron+json",
132  "application/iron+csv"));
133 
134  $this->setMethodPost();
135 
136  $this->mime("resultset");
137 
138  $this->setEndpoint("auth/registrar/access/");
139 
140  // Set default parameters for this query
141  $this->sourceInterface("default");
142  }
143 
163  public function create($group, $datasetUri, $crudPermission, $webservicesUris)
164  {
165  $this->params["group"] = urlencode($group);
166 
167  $this->params["crud"] = urlencode(($crudPermission->getCreate() ? "True" : "False").";".
168  ($crudPermission->getRead() ? "True" : "False").";".
169  ($crudPermission->getUpdate() ? "True" : "False").";".
170  ($crudPermission->getDelete() ? "True" : "False"));
171 
172  $this->params["ws_uris"] = urlencode(implode(";", $webservicesUris));
173 
174  $this->params["dataset"] = urlencode($datasetUri);
175 
176  $this->params["action"] = "create";
177 
178  return($this);
179  }
180 
191  public function deleteTarget($group, $datasetUri)
192  {
193  $this->params["group"] = urlencode($group);
194 
195  $this->params["dataset"] = urlencode($datasetUri);
196 
197  $this->params["action"] = "delete_target";
198 
199  return($this);
200  }
201 
202 
212  public function deleteSpecific($accessRecordUri)
213  {
214  $this->params["target_access_uri"] = urlencode($accessRecordUri);
215 
216  $this->params["action"] = "delete_specific";
217 
218  return($this);
219  }
220 
230  public function deleteAllDatasets($datasetUri)
231  {
232  $this->params["dataset"] = urlencode($datasetUri);
233 
234  $this->params["action"] = "delete_all";
235 
236  return($this);
237  }
238 
248  public function deleteAllGroups($groupUri)
249  {
250  $this->params["group"] = urlencode($groupUri);
251 
252  $this->params["action"] = "delete_all";
253 
254  return($this);
255  }
256 
277  public function update($accessRecordUri, $group, $datasetUri, $crudPermission, $webservicesUris)
278  {
279  $this->params["target_access_uri"] = urlencode($accessRecordUri);
280 
281  $this->params["group"] = urlencode($group);
282 
283  $this->params["crud"] = urlencode(($crudPermission->getCreate() ? "True" : "False").";".
284  ($crudPermission->getRead() ? "True" : "False").";".
285  ($crudPermission->getUpdate() ? "True" : "False").";".
286  ($crudPermission->getDelete() ? "True" : "False"));
287 
288  $this->params["ws_uris"] = urlencode(implode(";", $webservicesUris));
289 
290  $this->params["dataset"] = urlencode($datasetUri);
291 
292  $this->params["action"] = "update";
293 
294  return($this);
295  }
296  }
297 
299 ?>
update($accessRecordUri, $group, $datasetUri, $crudPermission, $webservicesUris)
Create a new access permissions record.
deleteAllGroups($groupUri)
Delete all accesses permissions records for a specific group.
create($group, $datasetUri, $crudPermission, $webservicesUris)
Create a new access permissions record.
deleteTarget($group, $datasetUri)
Delete a target access permissions record for a specific IP address and a specific dataset...
deleteAllDatasets($datasetUri)
Delete all accesses permissions records for a specific dataset.
Auth Registrar Access Query to a OSF Auth Registrar Access web service endpoint.