packagecom.onresolve.stash.groovy.test.listeners.STASH_3850_block_personalimportcom.atlassian.sal.api.component.ComponentLocatorimportcom.atlassian.stash.event.RepositoryCreationRequestedEventimportcom.atlassian.stash.project.ProjectTypeimportcom.atlassian.stash.repository.RepositoryService// only allow N personaldefrepositoryService=ComponentLocator.getComponent(RepositoryService)finalIntegerMAX_PERSONAL=5defevent=eventasRepositoryCreationRequestedEventdefproject=event.repository.projectif(project.type==ProjectType.PERSONAL){if(repositoryService.countByProject(project)>=MAX_PERSONAL){event.cancel("You can only create $MAX_PERSONAL personal repositories.")}}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.