Snippets

Adaptavist Stash - Block all Personal Repositories

Created by Jamie Echlin

File BlockAllPersonal.groovy Added

  • Ignore whitespace
  • Hide word diff
+package com.onresolve.stash.groovy.test.listeners.STASH_3850_block_personal
+
+import com.atlassian.stash.event.RepositoryCreationRequestedEvent
+import com.atlassian.stash.project.ProjectType
+
+def event = event as RepositoryCreationRequestedEvent
+
+// block all personal repos being created
+if (event.repository.project.type == ProjectType.PERSONAL) {
+    event.cancel("You cannot create personal repositories.")
+}
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.