Skip to content

Commit

Permalink
Fix allowed namespaces (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
iomodo authored Oct 4, 2021
1 parent ab70b6b commit e8242a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func (p *Plugin) GetToDo(user *gitlab.UserInfo) (bool, string, error) {

func (p *Plugin) isNamespaceAllowed(namespace string) error {
allowedNamespace := strings.TrimSpace(p.getConfiguration().GitlabGroup)
if allowedNamespace != "" && allowedNamespace != namespace {
if allowedNamespace != "" && allowedNamespace != namespace && !strings.HasPrefix(namespace, allowedNamespace) {
return fmt.Errorf("only repositories in the %s namespace are allowed", allowedNamespace)
}

Expand Down

0 comments on commit e8242a1

Please sign in to comment.