ACL rewrite

This commit is contained in:
2024-04-23 12:14:28 +02:00
parent d6c6572989
commit aea20b7a10
23 changed files with 435 additions and 180 deletions

View File

@@ -21,7 +21,6 @@ namespace Core\API\GpgKey {
use Core\API\Parameter\StringType;
use Core\API\Template\Render;
use Core\Driver\SQL\Condition\Compare;
use Core\Driver\SQL\Query\Insert;
use Core\Objects\Context;
use Core\Objects\DatabaseEntity\GpgKey;
use Core\Objects\DatabaseEntity\User;
@@ -137,8 +136,8 @@ namespace Core\API\GpgKey {
return $this->success;
}
public static function getDefaultACL(Insert $insert): void {
$insert->addRow(self::getEndpoint(), [], "Allows users to import gpg keys for a secure e-mail communication", true);
public static function getDescription(): string {
return "Allows users to import gpg keys for a secure e-mail communication";
}
}
@@ -170,8 +169,8 @@ namespace Core\API\GpgKey {
return $this->success;
}
public static function getDefaultACL(Insert $insert): void {
$insert->addRow(self::getEndpoint(), [], "Allows users to unlink gpg keys from their profile", true);
public static function getDescription(): string {
return "Allows users to unlink gpg keys from their profile";
}
}
@@ -219,6 +218,10 @@ namespace Core\API\GpgKey {
return $this->success;
}
public static function getDescription(): string {
return "Allows users to confirm their imported gpg key";
}
}
class Download extends GpgKeyAPI {
@@ -289,7 +292,9 @@ namespace Core\API\GpgKey {
header("Content-Disposition: attachment; filename=\"$fileName\"");
die($key);
}
public static function getDescription(): string {
return "Allows users to download any gpg public key";
}
}
}