{
    "componentChunkName": "component---src-templates-doc-tsx",
    "path": "/docs/3.9.x/en/development/permission-concept/",
    "result": {"data":{"navigation":{"nodes":[{"section":"Getting started","entries":[{"frontmatter":{"title":"Installation","subtitle":"Installation of scm-manager","partiallyActive":true},"fields":{"slug":"/docs/3.9.x/en/installation/"}},{"frontmatter":{"title":"First Startup","subtitle":"Administration User Creation","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/first-startup/"}},{"frontmatter":{"title":"Migrate from v1 to v3","subtitle":"How to use the Migration-Wizard","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/migrate-scm-manager-from-v1/"}},{"frontmatter":{"title":"Migrate from v2 to v3","subtitle":"Changes in the configuration","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/migrate-scm-manager-from-v2/"}},{"frontmatter":{"title":"Import existing repositories","subtitle":"How to import existing repositories into SCM-Manager","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/import/"}},{"frontmatter":{"title":"Frequently Asked Questions","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/faq/"}},{"frontmatter":{"title":"Known Issues","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/known-issues/"}}]},{"section":"User-oriented","entries":[{"frontmatter":{"title":"Repository","subtitle":null,"partiallyActive":true},"fields":{"slug":"/docs/3.9.x/en/user/repo/"}},{"frontmatter":{"title":"User","subtitle":null,"partiallyActive":true},"fields":{"slug":"/docs/3.9.x/en/user/user/"}},{"frontmatter":{"title":"Groups","subtitle":null,"partiallyActive":true},"fields":{"slug":"/docs/3.9.x/en/user/group/"}},{"frontmatter":{"title":"Administration","subtitle":null,"partiallyActive":true},"fields":{"slug":"/docs/3.9.x/en/user/admin/"}},{"frontmatter":{"title":"Profile","subtitle":null,"partiallyActive":true},"fields":{"slug":"/docs/3.9.x/en/user/profile/"}},{"frontmatter":{"title":"Notifications","subtitle":null,"partiallyActive":true},"fields":{"slug":"/docs/3.9.x/en/user/notification/"}},{"frontmatter":{"title":"CLI Client","subtitle":null,"partiallyActive":true},"fields":{"slug":"/docs/3.9.x/en/user/cli/"}},{"frontmatter":{"title":"Shortcuts","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/user/shortcuts/"}}]},{"section":"Administration","entries":[{"frontmatter":{"title":"Base Directory","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/administration/basedirectory/"}},{"frontmatter":{"title":"Logging","subtitle":"Configuration and locations of SCM-Manager logging","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/administration/logging/"}},{"frontmatter":{"title":"SCM-Server Configuration","subtitle":"Various configuration options for the SCM-Server","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/administration/scm-server/"}},{"frontmatter":{"title":"Reverse Proxy","subtitle":"How to use SCM-Manager with common reverse proxies","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/administration/reverse-proxies/"}},{"frontmatter":{"title":"Caching for Working Directories","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/administration/workdir_caching/"}}]},{"section":"Development","entries":[{"frontmatter":{"title":"Intellij IDEA Configuration","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/intellij-idea-configuration/"}},{"frontmatter":{"title":"Building SCM-Manager from Source","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/build-from-source/"}},{"frontmatter":{"title":"Architecture overview","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/architecture-overview/"}},{"frontmatter":{"title":"Common pitfall occurred while developing the SCM V2","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/ui-common-pitfall/"}},{"frontmatter":{"title":"Permission Concept","subtitle":"Fine-grained permission for SCM-Manager v2","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/permission-concept/"}},{"frontmatter":{"title":"Decision Table","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/decision-table/"}},{"frontmatter":{"title":"Error Handling","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/error-handling/"}},{"frontmatter":{"title":"Styleguide","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/styleguide/"}},{"frontmatter":{"title":"Testing Guide","subtitle":"Howto write tests for SCM-Manager","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/testing-guide/"}},{"frontmatter":{"title":"Integration Tests","subtitle":"How to run integration tests","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/integration-tests/"}},{"frontmatter":{"title":"UI-Extensions","subtitle":"How to extend the SCM-Manager UI with plugins","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/ui-extensions/"}},{"frontmatter":{"title":"I18n","subtitle":"Howto do internationalization","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/i18n/"}},{"frontmatter":{"title":"Building Forms","subtitle":"Howto build forms for SCM-Manager","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/building-forms/"}},{"frontmatter":{"title":"Javadoc","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/javadoc/"}},{"frontmatter":{"title":"CLI Guidelines","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/cli-guideline/"}},{"frontmatter":{"title":"Definition of Done","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/definition-of-done/"}},{"frontmatter":{"title":"DOD for UI development","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/ui-dod/"}}]},{"section":"Plugin Development","entries":[{"frontmatter":{"title":"Create a plugin","subtitle":"Create a new SCM-Manager plugin","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/plugins/create/"}},{"frontmatter":{"title":"Migrate a v1 plugin","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/plugins/migrate-plugin-from-v1/"}},{"frontmatter":{"title":"Extension Points","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/plugins/extension-points/"}},{"frontmatter":{"title":"i18n for Plugins","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/plugins/i18n-for-plugins/"}},{"frontmatter":{"title":"Plugin Descriptor","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/plugins/plugin-descriptor/"}},{"frontmatter":{"title":"SCM-Manager v2 Plugin Development","subtitle":null,"partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/plugins/plugin-development/"}},{"frontmatter":{"title":"Publish","subtitle":"Publish your Plugin","partiallyActive":null},"fields":{"slug":"/docs/3.9.x/en/development/plugins/publish/"}}]}]},"versions":{"group":[{"fieldValue":"1.0.x"},{"fieldValue":"1.x"},{"fieldValue":"2.0.x"},{"fieldValue":"2.1.x"},{"fieldValue":"2.10.x"},{"fieldValue":"2.11.x"},{"fieldValue":"2.12.x"},{"fieldValue":"2.13.x"},{"fieldValue":"2.14.x"},{"fieldValue":"2.15.x"},{"fieldValue":"2.16.x"},{"fieldValue":"2.17.x"},{"fieldValue":"2.18.x"},{"fieldValue":"2.19.x"},{"fieldValue":"2.2.x"},{"fieldValue":"2.20.x"},{"fieldValue":"2.21.x"},{"fieldValue":"2.22.x"},{"fieldValue":"2.23.x"},{"fieldValue":"2.24.x"},{"fieldValue":"2.25.x"},{"fieldValue":"2.26.x"},{"fieldValue":"2.27.x"},{"fieldValue":"2.28.x"},{"fieldValue":"2.29.x"},{"fieldValue":"2.3.x"},{"fieldValue":"2.30.x"},{"fieldValue":"2.31.x"},{"fieldValue":"2.32.x"},{"fieldValue":"2.33.x"},{"fieldValue":"2.34.x"},{"fieldValue":"2.35.x"},{"fieldValue":"2.36.x"},{"fieldValue":"2.37.x"},{"fieldValue":"2.38.x"},{"fieldValue":"2.39.x"},{"fieldValue":"2.4.x"},{"fieldValue":"2.40.x"},{"fieldValue":"2.41.x"},{"fieldValue":"2.42.x"},{"fieldValue":"2.43.x"},{"fieldValue":"2.44.x"},{"fieldValue":"2.45.x"},{"fieldValue":"2.46.x"},{"fieldValue":"2.47.x"},{"fieldValue":"2.48.x"},{"fieldValue":"2.5.x"},{"fieldValue":"2.6.x"},{"fieldValue":"2.7.x"},{"fieldValue":"2.8.x"},{"fieldValue":"2.9.x"},{"fieldValue":"3.0.x"},{"fieldValue":"3.1.x"},{"fieldValue":"3.10.x"},{"fieldValue":"3.11.x"},{"fieldValue":"3.2.x"},{"fieldValue":"3.3.x"},{"fieldValue":"3.4.x"},{"fieldValue":"3.5.x"},{"fieldValue":"3.6.x"},{"fieldValue":"3.7.x"},{"fieldValue":"3.8.x"},{"fieldValue":"3.9.x"}]},"languages":{"group":[{"fieldValue":"de"},{"fieldValue":"en"}]},"markdownRemark":{"html":"<p>This documents describes a concept for a fine-grained permission managing via the SCMMv2 UI.</p>\n<h2 id=\"requirements\" style=\"position:relative;\"><a href=\"#requirements\" aria-label=\"requirements permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Requirements</h2>\n<ul>\n<li>Provide at least the features of SCMMv1 including the scm-groupmanager and scm-userrepo plugins.</li>\n<li>In addition, the permissions on repositories should be more fine-grained, for example a user that does not have the\npermission to check out a repository, but read its meta data.</li>\n<li>An ideal solution would be generic. That is, not implementing explicit features such as the groupmanager or userrepo.<br>\nSCMMv2 already evaluates fine-grained permissions, so why not allow our users to assign them?</li>\n</ul>\n<h2 id=\"technical-foundations\" style=\"position:relative;\"><a href=\"#technical-foundations\" aria-label=\"technical foundations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Technical Foundations</h2>\n<h3 id=\"status-quo-scmv1\" style=\"position:relative;\"><a href=\"#status-quo-scmv1\" aria-label=\"status quo scmv1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Status Quo SCMv1</h3>\n<p>SCMMv1 's permissions are only related to Repositories:</p>\n<ul>\n<li>Users can either have the Permission READ, WRITER or OWNER</li>\n<li>globally (for all repositories) or</li>\n<li>per Repository.</li>\n</ul>\n<p>All other permissions are handled by distinguishing administrators from ordinary users.\nAdmins can do everything, users nothing except for their repository permissions.</p>\n<p>Some more permission-related features are added by plugins:</p>\n<ul>\n<li><a href=\"https://bitbucket.org/triologygmbh/scm-groupmanager-plugin/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">scm-groupmanager-plugin</a>: Allows users to administer groups</li>\n<li><a href=\"https://bitbucket.org/sdorra/scm-userrepo-plugin/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">scm-userrepo-plugin</a>: Allows users to create repositories</li>\n</ul>\n<h3 id=\"scmmv2-permission-fundamentals\" style=\"position:relative;\"><a href=\"#scmmv2-permission-fundamentals\" aria-label=\"scmmv2 permission fundamentals permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SCMMv2 Permission fundamentals</h3>\n<p>SCMMv2 introduces much more fine-grained permission checks under the hood.\nIn the code permissions for all kinds of operations are designed as follows:</p>\n<ul>\n<li>convention: <code class=\"language-text\">subject:verb:item</code>,</li>\n<li>for example: <code class=\"language-text\">configuration:read:git</code></li>\n<li>or <code class=\"language-text\">repository:write:42</code>,</li>\n<li>where item is the technical ID of the subject.</li>\n</ul>\n<p>In addition, there are permissions that do not relate to an item, which are called \"global permissions\", for example\n<code class=\"language-text\">configuration:list</code>.</p>\n<p>The challenge solved by this document is to provide a concept that allows SCMMv2 users to manage these permissions.\nThat is, to assign those permissions to users and groups via the UI or REST API.</p>\n<h3 id=\"scmmv2-implementation-details\" style=\"position:relative;\"><a href=\"#scmmv2-implementation-details\" aria-label=\"scmmv2 implementation details permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SCMMv2 implementation details</h3>\n<p>This is not a core part of the concept but might be interesting when implementing it.</p>\n<p>SCMM uses the Apache Shiro security framework that allows for assigning permission strings (such as <code class=\"language-text\">subject:verb:item</code>)\nto users. These can also contain wildcards (<code class=\"language-text\">*</code>). For example</p>\n<ul>\n<li>the permission <code class=\"language-text\">*</code> realizes the administrator,</li>\n<li><code class=\"language-text\">user:read:*</code> means reading is allowed on all users,</li>\n<li><code class=\"language-text\">user:*:arthur</code> means all operations are allowed on a specific user.</li>\n</ul>\n<p>Then the application can check if a user has a permission.\nFor example:</p>\n<ul>\n<li>Does user admin have the permission for reading repository 42?</li>\n<li>Admin has permission <code class=\"language-text\">*</code></li>\n<li>So: does he have permission <code class=\"language-text\">user:read:*</code>? Yes!</li>\n</ul>\n<p>In order to get a little more type safe, SCM-Manager uses the\n<a href=\"https://github.com/sdorra/Shiro-static-permissions\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Shiro-static-permissions (ssp) library</a> that scans the classpath for\nannotations such as the following</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"> <span class=\"token annotation punctuation\">@StaticPermissions</span><span class=\"token punctuation\">(</span>\n  value <span class=\"token operator\">=</span> <span class=\"token string\">\"user\"</span><span class=\"token punctuation\">,</span>\n  globalPermissions <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span><span class=\"token string\">\"create\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"list\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"autocomplete\"</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n  permissions <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span><span class=\"token string\">\"read\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"modify\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"delete\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"changePassword\"</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span></code></pre></div>\n<p>and creates <code class=\"language-text\">*Permissions</code> classes that contain methods for checking each permission, for example like so</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"><span class=\"token class-name\">UserPermissions</span><span class=\"token punctuation\">.</span><span class=\"token function\">read</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">.</span><span class=\"token function\">check</span><span class=\"token punctuation\">(</span>id<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>When a user logs in, all different kinds of permissions (<code class=\"language-text\">*</code> if admin, permissions for repositories,\nfrom groups, some additional technical permissions such as <code class=\"language-text\">autocomplete</code>, etc.)  are collected and added to the Shiro\nsubject in the <code class=\"language-text\">DefaultAuthorizationCollector</code> class.</p>\n<h3 id=\"scmmv2-core-permissions\" style=\"position:relative;\"><a href=\"#scmmv2-core-permissions\" aria-label=\"scmmv2 core permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SCMMv2 Core permissions</h3>\n<p>Here are some more examples of permissions existing in SCMMv2 core, at the time of writing.\nLook for <code class=\"language-text\">@StaticPermissions</code> and note that there the annotation also declares defaults for <code class=\"language-text\">permissions</code> and <code class=\"language-text\">globalPermissions</code>.</p>\n<ul>\n<li>Configuration\n<ul>\n<li>Global: list</li>\n<li>Permissions: read,write</li>\n<li>Items are global (core), git, hg, config (core plugins) and will be extended by further plugins.</li>\n</ul>\n</li>\n<li>Plugin\n<ul>\n<li>Global: read, manage</li>\n</ul>\n</li>\n<li>Group\n<ul>\n<li>Global: create, list, autocomplete</li>\n<li>Permission: read, modify, delete</li>\n</ul>\n</li>\n<li>User\n<ul>\n<li>Global: create, list, autocomplete</li>\n<li>Permissions:  read, modify, delete, changePassword</li>\n<li>Items are the user name of dynamically added users</li>\n</ul>\n</li>\n<li>Repository\n<ul>\n<li>Global: create</li>\n<li>Permissions: read, modify, delete, healthCheck, pull, push, permissionRead, permissionWrite</li>\n<li>Items are the technical ID of dynamically added repositories</li>\n</ul>\n</li>\n</ul>\n<h2 id=\"repository-and-global-permissions\" style=\"position:relative;\"><a href=\"#repository-and-global-permissions\" aria-label=\"repository and global permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repository and global permissions</h2>\n<p>In order to fulfill the requirements, this concept describes</p>\n<ul>\n<li>how to extend the existing repository permissions to be more fine-grained</li>\n<li>a new dialog to assign global permissions on user or group level</li>\n</ul>\n<h2 id=\"ui--ux\" style=\"position:relative;\"><a href=\"#ui--ux\" aria-label=\"ui  ux permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>UI / UX</h2>\n<h3 id=\"global-permissions\" style=\"position:relative;\"><a href=\"#global-permissions\" aria-label=\"global permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Global permissions</h3>\n<p>The global permission component can be reached from <strong>either user and groups</strong> components navigations. The following mockup\nshows this in the user component:</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 590px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 47.2972972972973%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAJABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAQBBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAerlgiWD/8QAFxAAAwEAAAAAAAAAAAAAAAAAAAMUIP/aAAgBAQABBQKdRMkmVj//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAXEAADAQAAAAAAAAAAAAAAAAAAATIg/9oACAEBAAY/AoRCIWP/xAAbEAACAQUAAAAAAAAAAAAAAAAAAREgIUGh0f/aAAgBAQABPyGZXBwdhZN1H//aAAwDAQACAAMAAAAQQM//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAcEAACAgIDAAAAAAAAAAAAAAABEQDRICExQXH/2gAIAQEAAT8QAYFADWzcaJnTNoly/bYf/9k='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Permissions mockup user\"\n        title=\"Permissions mockup user\"\n        src=\"/static/41b7a987f7819df286a58e6a1ea56a87/1c72d/permissions-mockup-user.jpg\"\n        srcset=\"/static/41b7a987f7819df286a58e6a1ea56a87/a80bd/permissions-mockup-user.jpg 148w,\n/static/41b7a987f7819df286a58e6a1ea56a87/1c91a/permissions-mockup-user.jpg 295w,\n/static/41b7a987f7819df286a58e6a1ea56a87/1c72d/permissions-mockup-user.jpg 590w,\n/static/41b7a987f7819df286a58e6a1ea56a87/a8a14/permissions-mockup-user.jpg 885w,\n/static/41b7a987f7819df286a58e6a1ea56a87/fbd2c/permissions-mockup-user.jpg 1180w,\n/static/41b7a987f7819df286a58e6a1ea56a87/09753/permissions-mockup-user.jpg 1389w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>\n<p>The layout of the permission component UI could look like this:</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 590px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 129.05405405405406%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAaABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAECA//EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHsAoyg2iX/xAAUEAEAAAAAAAAAAAAAAAAAAAAw/9oACAEBAAEFAk//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/AR//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAECAQE/AR//xAAUEAEAAAAAAAAAAAAAAAAAAAAw/9oACAEBAAY/Ak//xAAZEAADAAMAAAAAAAAAAAAAAAAAAREQICH/2gAIAQEAAT8hzBohelE9P//aAAwDAQACAAMAAAAQFBtC/8QAFBEBAAAAAAAAAAAAAAAAAAAAIP/aAAgBAwEBPxAf/8QAFBEBAAAAAAAAAAAAAAAAAAAAIP/aAAgBAgEBPxAf/8QAHRAAAgEEAwAAAAAAAAAAAAAAAAERITFRkRBBcf/aAAgBAQABPxBThjnD2VwtnarEUVzwOTwx7jI4QrH/2Q=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Permissions mockup global permissions\"\n        title=\"Permissions mockup global permissions\"\n        src=\"/static/888ecc277a0a5d09665cdcd5d535cd7b/1c72d/permissions-mockup-global-permissions.jpg\"\n        srcset=\"/static/888ecc277a0a5d09665cdcd5d535cd7b/a80bd/permissions-mockup-global-permissions.jpg 148w,\n/static/888ecc277a0a5d09665cdcd5d535cd7b/1c91a/permissions-mockup-global-permissions.jpg 295w,\n/static/888ecc277a0a5d09665cdcd5d535cd7b/1c72d/permissions-mockup-global-permissions.jpg 590w,\n/static/888ecc277a0a5d09665cdcd5d535cd7b/a8a14/permissions-mockup-global-permissions.jpg 885w,\n/static/888ecc277a0a5d09665cdcd5d535cd7b/fbd2c/permissions-mockup-global-permissions.jpg 1180w,\n/static/888ecc277a0a5d09665cdcd5d535cd7b/b4e83/permissions-mockup-global-permissions.jpg 1449w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>\n<p>The UI</p>\n<ul>\n<li>queries all available global permissions from the REST API (shiro strings),</li>\n<li>gets the display name and descriptions using the shiro strings as keys (see i18n),</li>\n<li>displays descriptions as tooltips,</li>\n<li>and queries all user/group permissions to populate the check boxes.</li>\n</ul>\n<h3 id=\"repository-permissions\" style=\"position:relative;\"><a href=\"#repository-permissions\" aria-label=\"repository permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repository permissions</h3>\n<p>The repository permission are already implemented and can be reached via Repositories | Permissions. Right now, it\nallows for assigning the roles READ, WRITE, OWNER as in SCMMv1 (see above). Internally they are mapped to shiro\npermissions (see <code class=\"language-text\">PermissionType</code>).</p>\n<p>The UI is extended like so:</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 590px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 44.5945945945946%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAJABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAECA//EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHZXmMkj//EABQQAQAAAAAAAAAAAAAAAAAAACD/2gAIAQEAAQUCX//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABQQAQAAAAAAAAAAAAAAAAAAACD/2gAIAQEABj8CX//EABgQAAIDAAAAAAAAAAAAAAAAAAEQESAx/9oACAEBAAE/IYocX//aAAwDAQACAAMAAAAQ1z//xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAgBAwEBPxBX/8QAFREBAQAAAAAAAAAAAAAAAAAAABH/2gAIAQIBAT8QR//EABwQAAICAgMAAAAAAAAAAAAAAAABETEhQXGBsf/aAAgBAQABPxBtZDi5Yqya6PUdvk//2Q=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Permissions mockup repository permissions\"\n        title=\"Permissions mockup repository permissions\"\n        src=\"/static/7d2769a25b0d38ab7fc1285143730650/1c72d/permissions-mockup-repository-permissions.jpg\"\n        srcset=\"/static/7d2769a25b0d38ab7fc1285143730650/a80bd/permissions-mockup-repository-permissions.jpg 148w,\n/static/7d2769a25b0d38ab7fc1285143730650/1c91a/permissions-mockup-repository-permissions.jpg 295w,\n/static/7d2769a25b0d38ab7fc1285143730650/1c72d/permissions-mockup-repository-permissions.jpg 590w,\n/static/7d2769a25b0d38ab7fc1285143730650/a8a14/permissions-mockup-repository-permissions.jpg 885w,\n/static/7d2769a25b0d38ab7fc1285143730650/fbd2c/permissions-mockup-repository-permissions.jpg 1180w,\n/static/7d2769a25b0d38ab7fc1285143730650/cc8bf/permissions-mockup-repository-permissions.jpg 3109w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>\n<h4 id=\"existing-repository-dialog\" style=\"position:relative;\"><a href=\"#existing-repository-dialog\" aria-label=\"existing repository dialog permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Existing repository dialog</h4>\n<ul>\n<li>queries all available repository permissions (shiro strings) and roles from the REST API,</li>\n<li>queries all user/group permissions of the repository (shiro strings) and aggregates them to roles to populate the\ndrop downs.</li>\n<li>Note that the permissions are always stored as shiro strings not roles.</li>\n<li>A new <code class=\"language-text\">Advanced</code> button per user or group entry opens a modal dialog</li>\n</ul>\n<h4 id=\"new-modal-dialog\" style=\"position:relative;\"><a href=\"#new-modal-dialog\" aria-label=\"new modal dialog permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>New modal dialog</h4>\n<ul>\n<li>The modal dialog shows all available repository permissions (shiro strings)</li>\n<li>via the shiro string the display name and descriptions are found (see i18n),</li>\n<li>displays descriptions as tooltips,</li>\n<li>the individual user/group permission of the repo are used to populate the check boxes</li>\n</ul>\n<h2 id=\"rest-api\" style=\"position:relative;\"><a href=\"#rest-api\" aria-label=\"rest api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>REST API</h2>\n<p>Note that the examples here are not specified in HAL/HATEOAS for brevity.</p>\n<h3 id=\"global-permissions-1\" style=\"position:relative;\"><a href=\"#global-permissions-1\" aria-label=\"global permissions 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Global permissions</h3>\n<p>Assigning global permissions must be implemented for <strong>either user and groups</strong>!\nBoth use the same available permissions.</p>\n<p>The following shows user as an example.</p>\n<h4 id=\"available-global-permissions\" style=\"position:relative;\"><a href=\"#available-global-permissions\" aria-label=\"available global permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Available global permissions</h4>\n<ul>\n<li>URL: <code class=\"language-text\">/globalPermissions</code></li>\n<li>HTTP Method: GET</li>\n<li>Payload example:</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"permissions\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n        <span class=\"token string\">\"configuration:read:git\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"configuration:write:git\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"configuration:read\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"configuration:write\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"plugin:read\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"plugin:write\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"group:read\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"user:read\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"repository:read\"</span>\n    <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h4 id=\"assigned-global-permissions\" style=\"position:relative;\"><a href=\"#assigned-global-permissions\" aria-label=\"assigned global permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Assigned global permissions</h4>\n<ul>\n<li>URL: <code class=\"language-text\">/users/{id}/permissions/</code></li>\n<li>HTTP Method: GET/PUT</li>\n<li>Payload example:</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"permissions\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n        <span class=\"token string\">\"configuration:read:git\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"configuration:write:git\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"configuration:read\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"configuration:write\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"plugin:read\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"plugin:write\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"group:read\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"user:read\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"repository:read\"</span>\n    <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h3 id=\"repository-permissions-1\" style=\"position:relative;\"><a href=\"#repository-permissions-1\" aria-label=\"repository permissions 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repository permissions</h3>\n<h4 id=\"available-repository-permissions\" style=\"position:relative;\"><a href=\"#available-repository-permissions\" aria-label=\"available repository permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Available repository permissions</h4>\n<ul>\n<li>URL: <code class=\"language-text\">/repositoryPermissions</code> (similar to <code class=\"language-text\">/repositoryTypes</code>)</li>\n<li>HTTP Method: GET</li>\n<li>Payload example:</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"roles\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Reader\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"verbs\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span> <span class=\"token string\">\"read\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"pull\"</span> <span class=\"token punctuation\">]</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Owner\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"verbs\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span> <span class=\"token string\">\"*\"</span> <span class=\"token punctuation\">]</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"verbs\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span> <span class=\"token string\">\"read\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"pull\"</span><span class=\"token punctuation\">,</span>  <span class=\"token string\">\"push\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"..\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"*\"</span> <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h4 id=\"assigned-repository-permissions\" style=\"position:relative;\"><a href=\"#assigned-repository-permissions\" aria-label=\"assigned repository permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Assigned repository permissions</h4>\n<p>Already implemented in <code class=\"language-text\">PermissionRootResource</code>. Needs to be adpated from roles (<code class=\"language-text\">WRITE</code>) to shiro permissions\n(<code class=\"language-text\">repository:read:42</code>).</p>\n<ul>\n<li>URL: <code class=\"language-text\">/repositories/{namespace}/{name}/permissions</code></li>\n<li>HTTP Method: GET</li>\n<li>Payload example:</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"permissions\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"trillian\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"permissions\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span> <span class=\"token string\">\"read\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"pull\"</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"groupPermission\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">false</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"owners\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"permissions\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span> <span class=\"token string\">\"*\"</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"groupPermission\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>This example shows the user <code class=\"language-text\">trillian</code>  having the <code class=\"language-text\">READER</code> role and the group <code class=\"language-text\">owners</code> having the <code class=\"language-text\">OWNER</code> role.\nNote that</p>\n<ul>\n<li>the <code class=\"language-text\">*</code> permission also implies all new permissions (e.g. defined by plugins or added in future versions)</li>\n</ul>\n<p>and therefore has different semantics as listing all currently available permissions.</p>\n<ul>\n<li>the permissions passed to the REST API correspond to the verbs of the repository permission. It is stored as\n<code class=\"language-text\">repositories:&lt;verb stored via REST API>:&lt;ID of the repository identified by namespace and name></code>.</li>\n<li>GET also returns links to individual URIs (e.g. <code class=\"language-text\">/repositories/{namespace}/{name}/permissions/trillian</code>) that can be\nused for updating permissions via PUT requests.</li>\n<li>On PUT, the REST API needs to <strong>validate</strong> that each entry in <code class=\"language-text\">permissions</code> does not contain <code class=\"language-text\">:</code>!<br>\nOtherwise we might allow for \"permission injection\", allowing to set permissions on other or all repositories.</li>\n</ul>\n<h2 id=\"java-api\" style=\"position:relative;\"><a href=\"#java-api\" aria-label=\"java api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Java API</h2>\n<p>The biggest technical challenges for this concept are the questions:</p>\n<ul>\n<li>Where do we get the available permission from?</li>\n<li>How do we assign these permissions?</li>\n<li>How are these permissions evaluated?</li>\n</ul>\n<p>Where each questions needs to be answered for</p>\n<ul>\n<li>global and</li>\n<li>repository</li>\n</ul>\n<p>permissions.</p>\n<h3 id=\"global-permissions-2\" style=\"position:relative;\"><a href=\"#global-permissions-2\" aria-label=\"global permissions 2 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Global permissions</h3>\n<p>In order to implement this for global permissions an existing mechanism of SCM-Manager can be used:\nThe <code class=\"language-text\">SecuritySystem</code>, implemented by the <code class=\"language-text\">DefaultSecuritySystem</code>.</p>\n<h4 id=\"list-available-permissions\" style=\"position:relative;\"><a href=\"#list-available-permissions\" aria-label=\"list available permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>List available permissions</h4>\n<p>The <code class=\"language-text\">DefaultSecuritySystem</code> reads all <code class=\"language-text\">permissions.xml</code> files from classpath, which also works for plugins (see\n<a href=\"https://bitbucket.org/sdorra/scm-manager/commits/4ed74bf266106c48db77d21558452b0c968884cb?at=feature/global_permissions#chg-scm-plugins/scm-git-plugin/src/main/resources/META-INF/scm/permissions.xml\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Proof Of Concept</a>).</p>\n<p>These can be queried using <code class=\"language-text\">securitySystem.getAvailablePermissions()</code>.</p>\n<p>For SCMMv2 we could extend this mechanism by</p>\n<ul>\n<li>simplifying the <code class=\"language-text\">permissions.xml</code> to contain only <code class=\"language-text\">&lt;permission>&lt;value></code>, because <code class=\"language-text\">&lt;display-name></code> and <code class=\"language-text\">&lt;description></code>\nneed to be internationalized, see i18n.</li>\n<li>extend the <code class=\"language-text\">ssp library</code> to generate <code class=\"language-text\">permissions.xml</code> files from <code class=\"language-text\">@StaticPermissions</code> annotations.\nThe annotations should be extended to support a list of permissions that are not written to <code class=\"language-text\">permissions.xml</code>\n(e.g. <code class=\"language-text\">user:autocomplete</code>)</li>\n</ul>\n<h4 id=\"assign-permissions\" style=\"position:relative;\"><a href=\"#assign-permissions\" aria-label=\"assign permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Assign permissions</h4>\n<p>The <code class=\"language-text\">SecuritySystem</code> also provides means to assign, store and load permissions to users or groups using Shiro string\npermissions like so:</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"><span class=\"token class-name\">AssignedPermission</span> groupPermission <span class=\"token operator\">=</span> <span class=\"token keyword\">new</span> <span class=\"token class-name\">AssignedPermission</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"configurers\"</span><span class=\"token punctuation\">,</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">,</span><span class=\"token string\">\"configuration:*\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\nsecuritySystem<span class=\"token punctuation\">.</span><span class=\"token function\">addPermission</span><span class=\"token punctuation\">(</span>groupPermission<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token class-name\">AssignedPermission</span> userPermission <span class=\"token operator\">=</span> <span class=\"token keyword\">new</span> <span class=\"token class-name\">AssignedPermission</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"arthur\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"group:*\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\nsecuritySystem<span class=\"token punctuation\">.</span><span class=\"token function\">addPermission</span><span class=\"token punctuation\">(</span>userPermission<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\nlog<span class=\"token punctuation\">.</span><span class=\"token function\">info</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"All permissions: {}\"</span><span class=\"token punctuation\">,</span> securitySystem<span class=\"token punctuation\">.</span><span class=\"token function\">getAllPermissions</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span> <span class=\"token comment\">// Contains the permissions just added</span></code></pre></div>\n<p>See also the <a href=\"https://bitbucket.org/sdorra/scm-manager/src/4a88315d8f3ce0ad9a7c428da1081fb7e4967fe3/scm-webapp/src/main/java/sonia/scm/api/v2/resources/GlobalPermissionPocResource.java?at=feature/global_permissions\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Proof Of Concept</a>.</p>\n<h4 id=\"evaluating-permissions\" style=\"position:relative;\"><a href=\"#evaluating-permissions\" aria-label=\"evaluating permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Evaluating permissions</h4>\n<p>The evaluation of permissions assigned via the <code class=\"language-text\">SecuritySystem</code> is already implemented in the\n<code class=\"language-text\">DefaultAuthorizationCollector</code>.</p>\n<h4 id=\"dynamically-add-new-items-to-available-permissions\" style=\"position:relative;\"><a href=\"#dynamically-add-new-items-to-available-permissions\" aria-label=\"dynamically add new items to available permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Dynamically add new items to available permissions</h4>\n<p>Adding items (e.g. new users) dynamically during runtime is not implemented by the <code class=\"language-text\">SecuritySystem</code> and in order to\nkeep this simple we do not plan to support it, yet. See considered alternatives.</p>\n<h3 id=\"repository-permissions-2\" style=\"position:relative;\"><a href=\"#repository-permissions-2\" aria-label=\"repository permissions 2 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repository Permissions</h3>\n<p>For repository permissions we need to implement a new mechanism for discovering available permissions .\nAssigning is already implemented (on role level, e.g. <code class=\"language-text\">WRITE</code>), which needs to be adapted to shiro permission level\n(e.g. <code class=\"language-text\">repository:read:42</code>).</p>\n<h4 id=\"list-available-permissions-1\" style=\"position:relative;\"><a href=\"#list-available-permissions-1\" aria-label=\"list available permissions 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>List available permissions</h4>\n<p>We need to implement a new mechanism for discovering available permssions. Let's call it <code class=\"language-text\">RepositoryPermissionResolver</code>.\nIt can work similar to the <code class=\"language-text\">DefaultSecuritySystem</code> (see global permissions). It reads all <code class=\"language-text\">repository-permissions.xml</code>\nfiles from classpath, which makes it extensible for plugins.</p>\n<p>This obsoletes the <code class=\"language-text\">PermissionType</code> enum.</p>\n<div class=\"gatsby-highlight\" data-language=\"xml\"><pre class=\"language-xml\"><code class=\"language-xml\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>permissions</span><span class=\"token punctuation\">></span></span>\n  \n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>permission</span><span class=\"token punctuation\">></span></span>read<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>permission</span><span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>permission</span><span class=\"token punctuation\">></span></span>write<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>permission</span><span class=\"token punctuation\">></span></span>\n   \n   <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>role</span><span class=\"token punctuation\">></span></span>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>name</span><span class=\"token punctuation\">></span></span>WRITER<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>name</span><span class=\"token punctuation\">></span></span>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>permission</span><span class=\"token punctuation\">></span></span>read<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>permission</span><span class=\"token punctuation\">></span></span>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>permission</span><span class=\"token punctuation\">></span></span>pull<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>permission</span><span class=\"token punctuation\">></span></span>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>permission</span><span class=\"token punctuation\">></span></span>push<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>permission</span><span class=\"token punctuation\">></span></span>\n   <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>role</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>permissions</span><span class=\"token punctuation\">></span></span>  </code></pre></div>\n<h4 id=\"assign-permissions-1\" style=\"position:relative;\"><a href=\"#assign-permissions-1\" aria-label=\"assign permissions 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Assign permissions</h4>\n<p>This is already implemented in <code class=\"language-text\">RepositoryManager</code>s. Needs to be adapted from roles (<code class=\"language-text\">WRITE</code>) to shiro permissions\n(<code class=\"language-text\">repository:read:42</code>).</p>\n<h4 id=\"evaluating-permissions-1\" style=\"position:relative;\"><a href=\"#evaluating-permissions-1\" aria-label=\"evaluating permissions 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Evaluating permissions</h4>\n<p>Same here: Already implemented in <code class=\"language-text\">DefaultAuthorizationCollector</code>. Needs to be adapted from roles to shiro permissions.</p>\n<h3 id=\"the-admin-flagrole\" style=\"position:relative;\"><a href=\"#the-admin-flagrole\" aria-label=\"the admin flagrole permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The Admin flag/role</h3>\n<p>In addition to the fine-grained permission management described in this concept, we could just keep the admin flag\n(or role) that add the permission <code class=\"language-text\">*</code> to a user.\nIt's already implemented and a well-known concept from SCMMv1.</p>\n<h3 id=\"permission-for-managing-permissions\" style=\"position:relative;\"><a href=\"#permission-for-managing-permissions\" aria-label=\"permission for managing permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Permission for managing permissions</h3>\n<p>Once permissions can be managed, an additional permission is necessary that answers the question: Who is allowed to\nmanage permissions?</p>\n<p>This permission has to be checked before permissions are read or written. It should be implemented in the\n<code class=\"language-text\">DefaultSecuritySystem</code>, instead of the <code class=\"language-text\">assertIsAdmin()</code> method.</p>\n<p>For now, it is sufficiently to create a <code class=\"language-text\">Permission</code> permission (using <code class=\"language-text\">@StaticPermissions</code>) with global verbs <code class=\"language-text\">read</code>\nand write. That is,</p>\n<ul>\n<li><code class=\"language-text\">permission:read</code></li>\n<li><code class=\"language-text\">permission:write</code></li>\n</ul>\n<h2 id=\"i18n\" style=\"position:relative;\"><a href=\"#i18n\" aria-label=\"i18n permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>i18n</h2>\n<p>Internationalization can be handled using the following conventions:</p>\n<ul>\n<li>All permission i18n are described in <code class=\"language-text\">plugins.json</code> (also for core), see <a href=\"../plugins/i18n-for-plugins\">i18n for Plugins</a></li>\n<li>That way the UI for users and groups can find all the translation in the same file</li>\n<li>Convention for i18n keys: <code class=\"language-text\">permissions.&lt;shiro-String></code>, containing <code class=\"language-text\">displayName</code> and <code class=\"language-text\">description</code> each.</li>\n</ul>\n<p>Example:</p>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"permissions\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"repository:read\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"displayName\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"All Repositories (read)\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"description\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Read access to all repositories\"</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h2 id=\"group-manager-plugin\" style=\"position:relative;\"><a href=\"#group-manager-plugin\" aria-label=\"group manager plugin permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Group Manager Plugin</h2>\n<p>One shortcoming of limiting the global permission concept to verbs (not items) is that the functionality of the\n<code class=\"language-text\">scm-groupmanager-plugin</code> is not included.\nThat is, we need to migrate our implement it for SCMMv2. Most likely it's less effort to implement a new plugin,\nbecause we need a new SCMMv2 UI and can use the SecuritySystem<code class=\"language-text\">to set the</code>group:*:<id>`.</p>\n<p>The following needs to be implemented:</p>\n<ul>\n<li>UI (core): Provide an extension point in the groups UI Navigation</li>\n<li>UI: Use the extension point to add link to new dialog for adding group managers</li>\n<li>UI: New Dialog similar to the repository permission dialog that allows for adding user as group managers</li>\n<li>REST API for CRUD of group admins</li>\n<li>Extend the available group plugins by a permission <code class=\"language-text\">group:manage</code> permission (<code class=\"language-text\">permission.xml</code>) including i18n in\n<code class=\"language-text\">plugins.json</code>.</li>\n<li>Check if the user has this permission! Unfortunately this cannot be done with <code class=\"language-text\">GroupPermissions</code> (generated via ssp),\nbut via <code class=\"language-text\">SecurityUtils.getSubject().checkPermission(permission);</code></li>\n<li>For storing the permission, make use of the <code class=\"language-text\">SecuritySystem</code> to set the <code class=\"language-text\">group:*:&lt;id></code> permissions.</li>\n</ul>\n<h2 id=\"considered-alternatives\" style=\"position:relative;\"><a href=\"#considered-alternatives\" aria-label=\"considered alternatives permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Considered alternatives</h2>\n<p>This chapter documents some other approaches that were considered but rejected and the reasons for rejecting them.</p>\n<ul>\n<li>Manage subject, verbs <em>and</em> items.<br>\nThis is the most flexible approach from a user perspective and SCMMv2 provides a mechanism for evaluating permissions\non the fine-grained <code class=\"language-text\">subject:verb:item</code> level, why not allow our users to make use of it?<br>\nThe <a href=\"https://bitbucket.org/sdorra/scm-manager/wiki/commits/4af3c47d7cce530e3707bb1915b7b269ebb692cc\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">first approach of this concept</a>\nfollowed this approach, but it was considered to cause to much effort during implementation. So we decided to keep it\nmore simple, and skip the <code class=\"language-text\">item</code> part. This suffices most use cases.</li>\n<li>A global permissions page (not per user, similar to the Jenkins Matrix Authorization Strategy Plugin).<br>\nLeads to a crowded UI, when there are a lot of subjects and verbs (see Jenkins). When adding items would cause an\nMicrosoft Excel-like UX, which is not desirable.</li>\n<li>Manage only subjects and verbs, not items.<br>\nWould simplify the UI and reduce the effort but the also the features and would not fulfill our requirements in terms\nof userrepo or groupmanager plugins. Those could still be implemented separately. Still, as SCMMv2 provides a\nmechanism for evaluate permissions on the fine-grained <code class=\"language-text\">subject:verb:item</code> level, why not allow our users to make use of it?</li>\n</ul>\n<h2 id=\"implemented-permissions\" style=\"position:relative;\"><a href=\"#implemented-permissions\" aria-label=\"implemented permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Implemented Permissions</h2>\n<p>This chapter documents the permissions implemented in SCM-Manager core and a lot of plugins that can be assigned to users and groups\nusing the GUI/API.\nBe aware, that this is only a snapshot and may not track each change in a plugin or the core. To get the concrete list of permissions\nfor a concrete version of the core or a plugin, take a look at the corresponding <code class=\"language-text\">permissions.xml</code>, <code class=\"language-text\">repository-permissions.xml</code> and\n<code class=\"language-text\">plugins.json</code> files.</p>\n<h3 id=\"global-permissions-3\" style=\"position:relative;\"><a href=\"#global-permissions-3\" aria-label=\"global permissions 3 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Global Permissions</h3>\n<table>\n<thead>\n<tr>\n<th>plugin</th>\n<th>permission</th>\n<th>description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">repository:read,pull:*</code></td>\n<td>read all repositories</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">repository:read,pull,push:*</code></td>\n<td>write all repositories</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">repository:*</code></td>\n<td>own all repositories</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">repository:create</code></td>\n<td>Create repositories</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">user:*</code></td>\n<td>administer users</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">group:*</code></td>\n<td>administer groups</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">configuration:list</code></td>\n<td>basic permission for all configuration permissions; needed to see config menu item</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">configuration:read,write:global</code></td>\n<td>administer core configuration</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">configuration:read,write:*</code></td>\n<td>administer overall configuration (including all plugins)</td>\n</tr>\n<tr>\n<td>git</td>\n<td><code class=\"language-text\">configuration:read,write:git</code></td>\n<td>administer global git settings</td>\n</tr>\n<tr>\n<td>git</td>\n<td><code class=\"language-text\">repository:git:*</code></td>\n<td>administer repository specific git settings</td>\n</tr>\n<tr>\n<td>hg</td>\n<td><code class=\"language-text\">configuration:read,write:hg</code></td>\n<td>administer global mercurial settings</td>\n</tr>\n<tr>\n<td>hg</td>\n<td><code class=\"language-text\">repository:hg:*</code></td>\n<td>administer repository specific mercurial settings</td>\n</tr>\n<tr>\n<td>svn</td>\n<td><code class=\"language-text\">configuration:read,write:svn</code></td>\n<td>administer global subversion settings</td>\n</tr>\n<tr>\n<td>svn</td>\n<td><code class=\"language-text\">repository:svn:*</code></td>\n<td>administer repository specific subversion settings</td>\n</tr>\n<tr>\n<td>authormapping</td>\n<td><code class=\"language-text\">repository:authormapping:*</code></td>\n<td>read and modify author mappings for all repositories</td>\n</tr>\n<tr>\n<td>auth-ldap</td>\n<td><code class=\"language-text\">configuration:read,write:ldap</code></td>\n<td>administer ldap server</td>\n</tr>\n<tr>\n<td>cas</td>\n<td><code class=\"language-text\">configuration:read,write:cas</code></td>\n<td>administer cas server</td>\n</tr>\n<tr>\n<td>statistic</td>\n<td><code class=\"language-text\">repository:computeStatistics:*</code></td>\n<td>recompute statistics for all repositories</td>\n</tr>\n<tr>\n<td>jenkins</td>\n<td><code class=\"language-text\">configuration:read,write:jenkins</code></td>\n<td>administer global jenkins server</td>\n</tr>\n<tr>\n<td>jenkins</td>\n<td><code class=\"language-text\">repository:jenkins:*</code></td>\n<td>administer repository specific jenkins servers</td>\n</tr>\n<tr>\n<td>jira</td>\n<td><code class=\"language-text\">configuration:read,write:jira</code></td>\n<td>administer global jira server</td>\n</tr>\n<tr>\n<td>jira</td>\n<td><code class=\"language-text\">repository:jira:*</code></td>\n<td>administer repository specific jira servers</td>\n</tr>\n<tr>\n<td>pathwp</td>\n<td><code class=\"language-text\">repository:pathwp:*</code></td>\n<td>administer write protected paths for all repositories</td>\n</tr>\n<tr>\n<td>branchwp</td>\n<td><code class=\"language-text\">repository:branchwp:*</code></td>\n<td>administer write protected paths for all repositories</td>\n</tr>\n<tr>\n<td>tagprotection</td>\n<td><code class=\"language-text\">configuration:read,write:tagprotection</code></td>\n<td>administer globally protected tags</td>\n</tr>\n<tr>\n<td>script</td>\n<td><code class=\"language-text\">script:read,modify,execute</code></td>\n<td>read, modify and execute scripts</td>\n</tr>\n<tr>\n<td>webhook</td>\n<td><code class=\"language-text\">configuration:read,write:webhook</code></td>\n<td>administer web hooks</td>\n</tr>\n<tr>\n<td>webhook</td>\n<td><code class=\"language-text\">repository:webhook:*</code></td>\n<td>administer web hooks for all repositories</td>\n</tr>\n<tr>\n<td>redmine</td>\n<td><code class=\"language-text\">configuration:read,write:redmine</code></td>\n<td>administer global redmine server</td>\n</tr>\n<tr>\n<td>redmine</td>\n<td><code class=\"language-text\">repository:redmine:*</code></td>\n<td>administer repository specific redmine servers</td>\n</tr>\n<tr>\n<td>notify</td>\n<td><code class=\"language-text\">repository:notify:*</code></td>\n<td>administer notify settings for all repositories</td>\n</tr>\n<tr>\n<td>support</td>\n<td><code class=\"language-text\">support:information</code></td>\n<td>read support relevant information</td>\n</tr>\n<tr>\n<td>support</td>\n<td><code class=\"language-text\">support:information,logging</code></td>\n<td>read support relevant information and enable trace log</td>\n</tr>\n<tr>\n<td>mail</td>\n<td><code class=\"language-text\">configuration:read,write:mail</code></td>\n<td>administer mail server</td>\n</tr>\n<tr>\n<td>groupmanager</td>\n<td><code class=\"language-text\">group:manage:*</code></td>\n<td>assign group managers</td>\n</tr>\n<tr>\n<td>ssh</td>\n<td><code class=\"language-text\">user:readAuthorizedKeys:*</code></td>\n<td>read authorization keys for all users</td>\n</tr>\n<tr>\n<td>ssh</td>\n<td><code class=\"language-text\">user:readAuthorizedKeys,writeAuthorizedKeys:*</code></td>\n<td>configure authorization keys for all users</td>\n</tr>\n</tbody>\n</table>\n<h3 id=\"repository-permissions-3\" style=\"position:relative;\"><a href=\"#repository-permissions-3\" aria-label=\"repository permissions 3 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repository Permissions</h3>\n<table>\n<thead>\n<tr>\n<th>plugin</th>\n<th>verb</th>\n<th>description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">read</code></td>\n<td>read metadata of repository</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">modify</code></td>\n<td>modify metadata of repository</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">delete</code></td>\n<td>delete repository</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">pull</code></td>\n<td>pull/checkout repository</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">push</code></td>\n<td>push/commit to repository</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">permissionRead</code></td>\n<td>read permissions of repository</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">permissionWrite</code></td>\n<td>modify permissions for repository</td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">*</code></td>\n<td>change everything for repository (\"owner\")</td>\n</tr>\n<tr>\n<td>git</td>\n<td><code class=\"language-text\">git</code></td>\n<td>administer git settings for repository</td>\n</tr>\n<tr>\n<td>hg</td>\n<td><code class=\"language-text\">hg</code></td>\n<td>administer mercurial settings for repository</td>\n</tr>\n<tr>\n<td>svn</td>\n<td><code class=\"language-text\">svn</code></td>\n<td>administer subversion settings for repository</td>\n</tr>\n<tr>\n<td>review</td>\n<td><code class=\"language-text\">createPullRequest</code></td>\n<td>create pull requests</td>\n</tr>\n<tr>\n<td>review</td>\n<td><code class=\"language-text\">readPullRequest</code></td>\n<td>read pull requests</td>\n</tr>\n<tr>\n<td>review</td>\n<td><code class=\"language-text\">commentPullRequest</code></td>\n<td>write comments in pull requests and delete/edit own comments</td>\n</tr>\n<tr>\n<td>review</td>\n<td><code class=\"language-text\">modifyPullRequest</code></td>\n<td>edit/delete pull requests and comments</td>\n</tr>\n<tr>\n<td>review</td>\n<td><code class=\"language-text\">mergePullRequest</code></td>\n<td>merge/reject pull requests</td>\n</tr>\n<tr>\n<td>authormapping</td>\n<td><code class=\"language-text\">authormapping</code></td>\n<td>modify author mappings</td>\n</tr>\n<tr>\n<td>jenkins</td>\n<td><code class=\"language-text\">jenkins</code></td>\n<td>administer jenkins server for repository</td>\n</tr>\n<tr>\n<td>jira</td>\n<td><code class=\"language-text\">jira</code></td>\n<td>administer jira server for repository</td>\n</tr>\n<tr>\n<td>pathwp</td>\n<td><code class=\"language-text\">pathwp</code></td>\n<td>administer write protected paths for repository</td>\n</tr>\n<tr>\n<td>redmine</td>\n<td><code class=\"language-text\">redmine</code></td>\n<td>administer redmine server for repository</td>\n</tr>\n<tr>\n<td>notify</td>\n<td><code class=\"language-text\">notify</code></td>\n<td>administer notify settings for repository</td>\n</tr>\n<tr>\n<td>branchwp</td>\n<td><code class=\"language-text\">branchwp</code></td>\n<td>administer write protected paths for repository</td>\n</tr>\n<tr>\n<td>webhook</td>\n<td><code class=\"language-text\">webhook</code></td>\n<td>administer web hools for repository</td>\n</tr>\n</tbody>\n</table>\n<h3 id=\"repository-roles\" style=\"position:relative;\"><a href=\"#repository-roles\" aria-label=\"repository roles permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repository Roles</h3>\n<p>The verbs for roles are merged internally, so that a resulting role will have all verbs specified by any plugin.\nMind that a <code class=\"language-text\">OWNER</code> has overall permissions, including all possible permissions for all plugins.</p>\n<table>\n<thead>\n<tr>\n<th>plugin</th>\n<th>role</th>\n<th>verbs</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">READ</code></td>\n<td><code class=\"language-text\">read</code>, <code class=\"language-text\">pull</code></td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">WRITE</code></td>\n<td><code class=\"language-text\">read</code>, <code class=\"language-text\">pull</code>, <code class=\"language-text\">push</code></td>\n</tr>\n<tr>\n<td>core</td>\n<td><code class=\"language-text\">OWNER</code></td>\n<td><code class=\"language-text\">*</code></td>\n</tr>\n<tr>\n<td>review</td>\n<td><code class=\"language-text\">READ</code></td>\n<td><code class=\"language-text\">readPullRequest</code></td>\n</tr>\n<tr>\n<td>review</td>\n<td><code class=\"language-text\">WRITE</code></td>\n<td><code class=\"language-text\">createPullRequest</code>, <code class=\"language-text\">readPullRequest</code>, <code class=\"language-text\">commentPullRequest</code>, <code class=\"language-text\">mergePullRequest</code></td>\n</tr>\n<tr>\n<td>statistic</td>\n<td><code class=\"language-text\">READ</code></td>\n<td><code class=\"language-text\">readStatistics</code></td>\n</tr>\n</tbody>\n</table>","description":"This documents describes a concept for a fine-grained permission managing via the SCMMv2 UI. Requirements Provide at least the features of SCMMv1 including the…","tableOfContents":"<ul>\n<li>\n<p><a href=\"#requirements\">Requirements</a></p>\n</li>\n<li>\n<p><a href=\"#technical-foundations\">Technical Foundations</a></p>\n<ul>\n<li><a href=\"#status-quo-scmv1\">Status Quo SCMv1</a></li>\n<li><a href=\"#scmmv2-permission-fundamentals\">SCMMv2 Permission fundamentals</a></li>\n<li><a href=\"#scmmv2-implementation-details\">SCMMv2 implementation details</a></li>\n<li><a href=\"#scmmv2-core-permissions\">SCMMv2 Core permissions</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#repository-and-global-permissions\">Repository and global permissions</a></p>\n</li>\n<li>\n<p><a href=\"#ui--ux\">UI / UX</a></p>\n<ul>\n<li>\n<p><a href=\"#global-permissions\">Global permissions</a></p>\n</li>\n<li>\n<p><a href=\"#repository-permissions\">Repository permissions</a></p>\n<ul>\n<li><a href=\"#existing-repository-dialog\">Existing repository dialog</a></li>\n<li><a href=\"#new-modal-dialog\">New modal dialog</a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li>\n<p><a href=\"#rest-api\">REST API</a></p>\n<ul>\n<li>\n<p><a href=\"#global-permissions-1\">Global permissions</a></p>\n<ul>\n<li><a href=\"#available-global-permissions\">Available global permissions</a></li>\n<li><a href=\"#assigned-global-permissions\">Assigned global permissions</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#repository-permissions-1\">Repository permissions</a></p>\n<ul>\n<li><a href=\"#available-repository-permissions\">Available repository permissions</a></li>\n<li><a href=\"#assigned-repository-permissions\">Assigned repository permissions</a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li>\n<p><a href=\"#java-api\">Java API</a></p>\n<ul>\n<li>\n<p><a href=\"#global-permissions-2\">Global permissions</a></p>\n<ul>\n<li><a href=\"#list-available-permissions\">List available permissions</a></li>\n<li><a href=\"#assign-permissions\">Assign permissions</a></li>\n<li><a href=\"#evaluating-permissions\">Evaluating permissions</a></li>\n<li><a href=\"#dynamically-add-new-items-to-available-permissions\">Dynamically add new items to available permissions</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#repository-permissions-2\">Repository Permissions</a></p>\n<ul>\n<li><a href=\"#list-available-permissions-1\">List available permissions</a></li>\n<li><a href=\"#assign-permissions-1\">Assign permissions</a></li>\n<li><a href=\"#evaluating-permissions-1\">Evaluating permissions</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#the-admin-flagrole\">The Admin flag/role</a></p>\n</li>\n<li>\n<p><a href=\"#permission-for-managing-permissions\">Permission for managing permissions</a></p>\n</li>\n</ul>\n</li>\n<li>\n<p><a href=\"#i18n\">i18n</a></p>\n</li>\n<li>\n<p><a href=\"#group-manager-plugin\">Group Manager Plugin</a></p>\n</li>\n<li>\n<p><a href=\"#considered-alternatives\">Considered alternatives</a></p>\n</li>\n<li>\n<p><a href=\"#implemented-permissions\">Implemented Permissions</a></p>\n<ul>\n<li><a href=\"#global-permissions-3\">Global Permissions</a></li>\n<li><a href=\"#repository-permissions-3\">Repository Permissions</a></li>\n<li><a href=\"#repository-roles\">Repository Roles</a></li>\n</ul>\n</li>\n</ul>","frontmatter":{"title":"Permission Concept","subtitle":"Fine-grained permission for SCM-Manager v2","displayToc":null,"description":null,"keywords":null,"image":null}}},"pageContext":{"slug":"/docs/3.9.x/en/development/permission-concept/","version":"3.9.x","latestVersion":"3.11.x","latestPageVersion":"3.11.x","language":"en","relativePath":"/development/permission-concept/","canonicalPath":"/docs/latest/en/development/permission-concept/","latestRootPath":"/docs/3.11.x/en/"}},
    "staticQueryHashes": ["1973669194","2742214048","2956773653","2957019495","698804963"]}