Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change ALLOWED_PERMISSIONS to a regex

  • Loading branch information...
commit 461f1c4c3ee64a881ad32688b9e5893f860f0870 1 parent 420d073
@wingrunr21 wingrunr21 authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/gitolite/config/repo.rb
View
4 lib/gitolite/config/repo.rb
@@ -5,7 +5,7 @@ class Config
#Represents a repo inside the gitolite configuration. The name, permissions, and git config
#options are all encapsulated in this class
class Repo
- ALLOWED_PERMISSIONS = ['C', 'R', 'RW', 'RW+', 'RWC', 'RW+C', 'RWD', 'RW+D', 'RWCD', 'RW+CD', '-']
+ ALLOWED_PERMISSIONS = /-|R|RW+?C?D?/
attr_accessor :permissions, :name, :config, :owner, :description
@@ -25,7 +25,7 @@ def clean_permissions
end
def add_permission(perm, refex = "", *users)
- if ALLOWED_PERMISSIONS.include? perm
+ if perm =~ ALLOWED_PERMISSIONS
#Handle deny rules
if perm == '-'
@permissions.push(@perm_hash_lambda.call)
Please sign in to comment.
Something went wrong with that request. Please try again.