|
|
@@ -589,47 +589,4 @@ class Core_AclBase {
|
|
|
return $deleted;
|
|
|
}
|
|
|
|
|
|
- public static function getAclByNamespace($namespace, $forceTblAclInit) {
|
|
|
- $userAcl = User::getAcl();
|
|
|
- $userAcl->fetchGroups();
|
|
|
- if ('http' != substr($namespace, 0, 4)) $namespace = Api_WfsNs::getBaseWfsUri() . '/' . $namespace;//Request::getHostUri() . '/' . $namespace;
|
|
|
-
|
|
|
- $baseNsUri = Api_WfsNs::getBaseWfsUri();
|
|
|
- if ("{$baseNsUri}/" == substr($namespace, 0, strlen($baseNsUri) + 1)) {
|
|
|
- $schemaNs = substr($namespace, strlen($baseNsUri) + 1);
|
|
|
- $ns = explode('/', $schemaNs);// "http://biuro.biall-net.pl/wfs/ default_db/{$nazwa_tabeli}/{$nazwa_obj}
|
|
|
- $sourceName = array_shift($ns);// remove first element - source name
|
|
|
- if ('default_db' == $sourceName || 'p5_default_db' == $sourceName) {
|
|
|
- $sourceName = 'default_db';
|
|
|
- $objName = $ns[0];
|
|
|
- if (1 == count($ns)) {
|
|
|
- $acl = $userAcl->getObjectAcl($sourceName, $objName);
|
|
|
- if (!$acl) throw new Exception("Could not get acl for '{$schemaNs}'");
|
|
|
- $acl->init($forceTblAclInit);
|
|
|
- return $acl;
|
|
|
- }
|
|
|
- else throw new Exception("Nieznany namespace default_db: '{$schemaNs}'", 501);
|
|
|
- }
|
|
|
- else if ('default_objects' == $sourceName || 'SystemObjects' == $sourceName || 'p5_objects' == $sourceName) {
|
|
|
- $sourceName = 'objects';
|
|
|
- $objName = $ns[0];
|
|
|
- if (1 == count($ns)) {
|
|
|
- $acl = $userAcl->getObjectAcl($sourceName, $objName);
|
|
|
- if (!$acl) throw new Exception("Could not get acl for '{$schemaNs}'");
|
|
|
- $acl->init($forceTblAclInit);
|
|
|
- return $acl;
|
|
|
- }
|
|
|
- else throw new Exception("Nieznany namespace SystemObjects: '{$schemaNs}'", 501);
|
|
|
- }
|
|
|
- else if ('zasob_' == substr($sourceName, 0, 6)) {
|
|
|
- $dbName = substr($sourceName, 6);
|
|
|
- throw new Exception("TODO db[{$dbName}] namespace '{$schemaNs}'", 501);
|
|
|
- }
|
|
|
- else throw new Exception("Nieznany namespace '{$schemaNs}'", 501);
|
|
|
- }
|
|
|
- else throw new HttpException("Zasoby zewnętrzenj systemu nie są jeszcze zaimplementowane", 501);
|
|
|
-
|
|
|
- throw new HttpException("TODO L.".__LINE__." ns({$namespace})", 501);
|
|
|
- }
|
|
|
-
|
|
|
}
|