Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohannes Leuker <j.leuker@hosting.de>2021-04-15 19:02:39 +0300
committerJohannes Leuker <j.leuker@hosting.de>2021-05-25 12:29:32 +0300
commitd606799ee2b3a6e11e616cd5606901754aa70c93 (patch)
tree5dd771f5f6991a7296b0e8dc60d2745ed0a7549f /lib
parentf031dd61c14a093effeb5773323f578abd65d54f (diff)
Add commands to manage tags via OCC
list, add, delete, edit Signed-off-by: Johannes Leuker <j.leuker@hosting.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php4
-rw-r--r--lib/composer/composer/autoload_static.php12
-rw-r--r--lib/private/SystemTag/SystemTag.php15
-rw-r--r--lib/public/SystemTag/ISystemTag.php30
4 files changed, 57 insertions, 4 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index 3033c0f69e5..2751d958efc 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -867,6 +867,10 @@ return array(
'OC\\Core\\Command\\Security\\RemoveCertificate' => $baseDir . '/core/Command/Security/RemoveCertificate.php',
'OC\\Core\\Command\\Security\\ResetBruteforceAttempts' => $baseDir . '/core/Command/Security/ResetBruteforceAttempts.php',
'OC\\Core\\Command\\Status' => $baseDir . '/core/Command/Status.php',
+ 'OC\\Core\\Command\\SystemTag\\Add' => $baseDir . '/core/Command/SystemTag/Add.php',
+ 'OC\\Core\\Command\\SystemTag\\Delete' => $baseDir . '/core/Command/SystemTag/Delete.php',
+ 'OC\\Core\\Command\\SystemTag\\Edit' => $baseDir . '/core/Command/SystemTag/Edit.php',
+ 'OC\\Core\\Command\\SystemTag\\ListCommand' => $baseDir . '/core/Command/SystemTag/ListCommand.php',
'OC\\Core\\Command\\TwoFactorAuth\\Base' => $baseDir . '/core/Command/TwoFactorAuth/Base.php',
'OC\\Core\\Command\\TwoFactorAuth\\Cleanup' => $baseDir . '/core/Command/TwoFactorAuth/Cleanup.php',
'OC\\Core\\Command\\TwoFactorAuth\\Disable' => $baseDir . '/core/Command/TwoFactorAuth/Disable.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index dafae4aa46e..a294f22719c 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -7,7 +7,7 @@ namespace Composer\Autoload;
class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
{
public static $prefixLengthsPsr4 = array (
- 'O' =>
+ 'O' =>
array (
'OC\\Core\\' => 8,
'OC\\' => 3,
@@ -16,15 +16,15 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
);
public static $prefixDirsPsr4 = array (
- 'OC\\Core\\' =>
+ 'OC\\Core\\' =>
array (
0 => __DIR__ . '/../../..' . '/core',
),
- 'OC\\' =>
+ 'OC\\' =>
array (
0 => __DIR__ . '/../../..' . '/lib/private',
),
- 'OCP\\' =>
+ 'OCP\\' =>
array (
0 => __DIR__ . '/../../..' . '/lib/public',
),
@@ -896,6 +896,10 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Core\\Command\\Security\\RemoveCertificate' => __DIR__ . '/../../..' . '/core/Command/Security/RemoveCertificate.php',
'OC\\Core\\Command\\Security\\ResetBruteforceAttempts' => __DIR__ . '/../../..' . '/core/Command/Security/ResetBruteforceAttempts.php',
'OC\\Core\\Command\\Status' => __DIR__ . '/../../..' . '/core/Command/Status.php',
+ 'OC\\Core\\Command\\SystemTag\\Add' => __DIR__ . '/../../..' . '/core/Command/SystemTag/Add.php',
+ 'OC\\Core\\Command\\SystemTag\\Delete' => __DIR__ . '/../../..' . '/core/Command/SystemTag/Delete.php',
+ 'OC\\Core\\Command\\SystemTag\\Edit' => __DIR__ . '/../../..' . '/core/Command/SystemTag/Edit.php',
+ 'OC\\Core\\Command\\SystemTag\\ListCommand' => __DIR__ . '/../../..' . '/core/Command/SystemTag/ListCommand.php',
'OC\\Core\\Command\\TwoFactorAuth\\Base' => __DIR__ . '/../../..' . '/core/Command/TwoFactorAuth/Base.php',
'OC\\Core\\Command\\TwoFactorAuth\\Cleanup' => __DIR__ . '/../../..' . '/core/Command/TwoFactorAuth/Cleanup.php',
'OC\\Core\\Command\\TwoFactorAuth\\Disable' => __DIR__ . '/../../..' . '/core/Command/TwoFactorAuth/Disable.php',
diff --git a/lib/private/SystemTag/SystemTag.php b/lib/private/SystemTag/SystemTag.php
index 8a48e048d39..a33fadd9906 100644
--- a/lib/private/SystemTag/SystemTag.php
+++ b/lib/private/SystemTag/SystemTag.php
@@ -93,4 +93,19 @@ class SystemTag implements ISystemTag {
public function isUserAssignable(): bool {
return $this->userAssignable;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getAccessLevel(): int {
+ if ($this->userVisible) {
+ if ($this->userAssignable) {
+ return self::ACCESS_LEVEL_PUBLIC;
+ } else {
+ return self::ACCESS_LEVEL_RESTRICTED;
+ }
+ } else {
+ return self::ACCESS_LEVEL_INVISIBLE;
+ }
+ }
}
diff --git a/lib/public/SystemTag/ISystemTag.php b/lib/public/SystemTag/ISystemTag.php
index 39adb39ec08..b4dfc6856ed 100644
--- a/lib/public/SystemTag/ISystemTag.php
+++ b/lib/public/SystemTag/ISystemTag.php
@@ -32,6 +32,27 @@ namespace OCP\SystemTag;
* @since 9.0.0
*/
interface ISystemTag {
+ /**
+ * @since 22.0.0
+ */
+ public const ACCESS_LEVEL_PUBLIC = 0;
+ /**
+ * @since 22.0.0
+ */
+ public const ACCESS_LEVEL_RESTRICTED = 1;
+ /**
+ * @since 22.0.0
+ */
+ public const ACCESS_LEVEL_INVISIBLE = 2;
+
+ /**
+ * @since 22.0.0
+ */
+ public const ACCESS_LEVEL_LOOKUP = [
+ ISystemTag::ACCESS_LEVEL_PUBLIC => 'public',
+ ISystemTag::ACCESS_LEVEL_RESTRICTED => 'restricted',
+ ISystemTag::ACCESS_LEVEL_INVISIBLE => 'invisible',
+ ];
/**
* Returns the tag id
@@ -68,4 +89,13 @@ interface ISystemTag {
* @since 9.0.0
*/
public function isUserAssignable(): bool;
+
+ /**
+ * Returns a term summarizing the access control flags
+ *
+ * @return int the level of access control
+ *
+ * @since 22.0.0
+ */
+ public function getAccessLevel(): int;
}