ISystemTag.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Johannes Leuker <j.leuker@hosting.de>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. * @author Vincent Petry <vincent@nextcloud.com>
  9. *
  10. * @license AGPL-3.0
  11. *
  12. * This code is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License, version 3,
  14. * as published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License, version 3,
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>
  23. *
  24. */
  25. namespace OCP\SystemTag;
  26. /**
  27. * Public interface for a system-wide tag.
  28. *
  29. * @since 9.0.0
  30. */
  31. interface ISystemTag {
  32. /**
  33. * @since 22.0.0
  34. */
  35. public const ACCESS_LEVEL_PUBLIC = 0;
  36. /**
  37. * @since 22.0.0
  38. */
  39. public const ACCESS_LEVEL_RESTRICTED = 1;
  40. /**
  41. * @since 22.0.0
  42. */
  43. public const ACCESS_LEVEL_INVISIBLE = 2;
  44. /**
  45. * @since 22.0.0
  46. */
  47. public const ACCESS_LEVEL_LOOKUP = [
  48. ISystemTag::ACCESS_LEVEL_PUBLIC => 'public',
  49. ISystemTag::ACCESS_LEVEL_RESTRICTED => 'restricted',
  50. ISystemTag::ACCESS_LEVEL_INVISIBLE => 'invisible',
  51. ];
  52. /**
  53. * Returns the tag id
  54. *
  55. * @return string id
  56. *
  57. * @since 9.0.0
  58. */
  59. public function getId(): string;
  60. /**
  61. * Returns the tag display name
  62. *
  63. * @return string tag display name
  64. *
  65. * @since 9.0.0
  66. */
  67. public function getName(): string;
  68. /**
  69. * Returns whether the tag is visible for regular users
  70. *
  71. * @return bool true if visible, false otherwise
  72. *
  73. * @since 9.0.0
  74. */
  75. public function isUserVisible(): bool;
  76. /**
  77. * Returns whether the tag can be assigned to objects by regular users
  78. *
  79. * @return bool true if assignable, false otherwise
  80. *
  81. * @since 9.0.0
  82. */
  83. public function isUserAssignable(): bool;
  84. /**
  85. * Returns a term summarizing the access control flags
  86. *
  87. * @return int the level of access control
  88. *
  89. * @since 22.0.0
  90. */
  91. public function getAccessLevel(): int;
  92. }