Snippets

Adaptavist Stash - Block all Personal Repositories

Created by Jamie Echlin
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.")
}

Comments (0)

HTTPS SSH

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