diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index 66b3d1f29d..83c2120bed 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -25,7 +25,6 @@ use Utopia\Audit\Audit; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; $attributesCallback = function ($attribute, $response, $dbForExternal, $database, $audits) { /** @var Utopia\Database\Document $document*/ @@ -114,7 +113,7 @@ $attributesCallback = function ($attribute, $response, $dbForExternal, $database $audits ->setParam('event', 'database.attributes.create') - ->setParam('resource', 'database/attributes/'.$attribute->getId()) + ->setParam('resource', 'database/collection/'.$collection->getId()) ->setParam('data', $attribute) ; @@ -287,6 +286,7 @@ App::get('/v1/database/collections/:collectionId/logs') $output[$i] = new Document([ 'event' => $log['event'], + 'userId' => $log['userId'], 'ip' => $log['ip'], 'time' => $log['time'], @@ -367,7 +367,7 @@ App::put('/v1/database/collections/:collectionId') $audits ->setParam('event', 'database.collections.update') - ->setParam('resource', 'database/collections/'.$collection->getId()) + ->setParam('resource', 'database/collection/'.$collection->getId()) ->setParam('data', $collection->getArrayCopy()) ; @@ -411,7 +411,7 @@ App::delete('/v1/database/collections/:collectionId') $audits ->setParam('event', 'database.collections.delete') - ->setParam('resource', 'database/collections/'.$collection->getId()) + ->setParam('resource', 'database/collection/'.$collection->getId()) ->setParam('data', $collection->getArrayCopy()) ; @@ -841,7 +841,7 @@ App::delete('/v1/database/collections/:collectionId/attributes/:attributeId') $audits ->setParam('event', 'database.attributes.delete') - ->setParam('resource', 'database/attributes/'.$attribute->getId()) + ->setParam('resource', 'database/collection/'.$collection->getId()) ->setParam('data', $attribute->getArrayCopy()) ; @@ -927,7 +927,7 @@ App::post('/v1/database/collections/:collectionId/indexes') $audits ->setParam('event', 'database.indexes.create') - ->setParam('resource', 'database/indexes/'.$index->getId()) + ->setParam('resource', 'database/collection/'.$collection->getId()) ->setParam('data', $index->getArrayCopy()) ; @@ -1070,7 +1070,7 @@ App::delete('/v1/database/collections/:collectionId/indexes/:indexId') $audits ->setParam('event', 'database.indexes.delete') - ->setParam('resource', 'database/indexes/'.$index->getId()) + ->setParam('resource', 'database/collection/'.$collection->getId()) ->setParam('data', $index->getArrayCopy()) ; diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index 4ad919cc2b..5b71aa9b93 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -305,7 +305,7 @@
| Date | +Date | Event | Client | Location | diff --git a/app/views/console/database/collection.phtml b/app/views/console/database/collection.phtml index 35ce5222f1..c96401fa9f 100644 --- a/app/views/console/database/collection.phtml +++ b/app/views/console/database/collection.phtml @@ -338,26 +338,27 @@
|---|
| Date | +Date | User | Event | Location | IP |
|---|---|---|---|---|---|
|
@@ -404,21 +405,39 @@
-
-
-
-
-
diff --git a/public/dist/scripts/app-all.js b/public/dist/scripts/app-all.js
index 14666270ee..569a6d46f5 100644
--- a/public/dist/scripts/app-all.js
+++ b/public/dist/scripts/app-all.js
@@ -201,11 +201,12 @@ let path='/database/collections/{collectionId}/indexes'.replace('{collectionId}'
if(typeof type!=='undefined'){payload['type']=type;}
if(typeof attributes!=='undefined'){payload['attributes']=attributes;}
if(typeof orders!=='undefined'){payload['orders']=orders;}
-const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getIndex:(collectionId,indexId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
+console.log(collectionId,indexId,type,attributes,orders);const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getIndex:(collectionId,indexId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof indexId==='undefined'){throw new AppwriteException('Missing required parameter: "indexId"');}
let path='/database/collections/{collectionId}/indexes/{indexId}'.replace('{collectionId}',collectionId).replace('{indexId}',indexId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteIndex:(collectionId,indexId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof indexId==='undefined'){throw new AppwriteException('Missing required parameter: "indexId"');}
-let path='/database/collections/{collectionId}/indexes/{indexId}'.replace('{collectionId}',collectionId).replace('{indexId}',indexId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);})};this.functions={list:(search,limit,offset,orderType)=>__awaiter(this,void 0,void 0,function*(){let path='/functions';let payload={};if(typeof search!=='undefined'){payload['search']=search;}
+let path='/database/collections/{collectionId}/indexes/{indexId}'.replace('{collectionId}',collectionId).replace('{indexId}',indexId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getCollectionLogs:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
+let path='/database/collections/{collectionId}/logs'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);})};this.functions={list:(search,limit,offset,orderType)=>__awaiter(this,void 0,void 0,function*(){let path='/functions';let payload={};if(typeof search!=='undefined'){payload['search']=search;}
if(typeof limit!=='undefined'){payload['limit']=limit;}
if(typeof offset!=='undefined'){payload['offset']=offset;}
if(typeof orderType!=='undefined'){payload['orderType']=orderType;}
diff --git a/public/dist/scripts/app-dep.js b/public/dist/scripts/app-dep.js
index ebb12681a5..53feccdb03 100644
--- a/public/dist/scripts/app-dep.js
+++ b/public/dist/scripts/app-dep.js
@@ -201,11 +201,12 @@ let path='/database/collections/{collectionId}/indexes'.replace('{collectionId}'
if(typeof type!=='undefined'){payload['type']=type;}
if(typeof attributes!=='undefined'){payload['attributes']=attributes;}
if(typeof orders!=='undefined'){payload['orders']=orders;}
-const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getIndex:(collectionId,indexId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
+console.log(collectionId,indexId,type,attributes,orders);const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getIndex:(collectionId,indexId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof indexId==='undefined'){throw new AppwriteException('Missing required parameter: "indexId"');}
let path='/database/collections/{collectionId}/indexes/{indexId}'.replace('{collectionId}',collectionId).replace('{indexId}',indexId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteIndex:(collectionId,indexId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof indexId==='undefined'){throw new AppwriteException('Missing required parameter: "indexId"');}
-let path='/database/collections/{collectionId}/indexes/{indexId}'.replace('{collectionId}',collectionId).replace('{indexId}',indexId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);})};this.functions={list:(search,limit,offset,orderType)=>__awaiter(this,void 0,void 0,function*(){let path='/functions';let payload={};if(typeof search!=='undefined'){payload['search']=search;}
+let path='/database/collections/{collectionId}/indexes/{indexId}'.replace('{collectionId}',collectionId).replace('{indexId}',indexId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getCollectionLogs:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
+let path='/database/collections/{collectionId}/logs'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);})};this.functions={list:(search,limit,offset,orderType)=>__awaiter(this,void 0,void 0,function*(){let path='/functions';let payload={};if(typeof search!=='undefined'){payload['search']=search;}
if(typeof limit!=='undefined'){payload['limit']=limit;}
if(typeof offset!=='undefined'){payload['offset']=offset;}
if(typeof orderType!=='undefined'){payload['orderType']=orderType;}
Permissions- - - -Add * for wildcard access
-
-
-
- Add * for wildcard access
+
+
+
+ Choose the permissions model for this collection. + ++ +
+
+
+
+ Document Level
+
Bla bla bla bla bla Bla blabla bla Bla blabla bla Bla blabla bla Bla blaBla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla +
+
+
+
+
+ Collection Level
+
+ Bla bla bla Bla blabla bla Bla blabla bla Bla blabla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla + + + +Add * for wildcard access
+
+
+
+ Add * for wildcard access
+ + |