Permalink
Browse files

Change ALLOWED_PERMISSIONS to a regex

  • Loading branch information...
1 parent 420d073 commit 461f1c4c3ee64a881ad32688b9e5893f860f0870 @wingrunr21 wingrunr21 committed Oct 23, 2011
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)

0 comments on commit 461f1c4

Please sign in to comment.