Commits

Sebastian Sdorra committed f571b03

glob syntax for branch names

  • Participants
  • Parent commits e03821f

Comments (0)

Files changed (2)

src/main/java/sonia/scm/branchwp/BranchWPPreReceiveRepositoryHook.java

 import sonia.scm.repository.Repository;
 import sonia.scm.repository.RepositoryHookEvent;
 import sonia.scm.user.User;
+import sonia.scm.util.GlobUtil;
 import sonia.scm.util.SecurityUtil;
 import sonia.scm.web.security.WebSecurityContext;
 
       for (BranchWPPermission bwp : permissions)
       {
         //J-
-        if (branch.equals(bwp.getBranch())
+        if (GlobUtil.matches(bwp.getBranch(), branch)
            && ((bwp.isGroup() && context.getGroups().contains(bwp.getName()))
            || (!bwp.isGroup() && username.equals(bwp.getName()))))
         {

src/main/resources/scm/sonia.branchwp.js

   
   enableHelpText: 'Enable Branch write protection. \n\
     Only admins, owners and users defined in the whitelist below are able to write.',
-  branchwpGridHelpText: 'Branch write protection whitelist.',
+  branchwpGridHelpText: 'Branch write protection whitelist. <b>Note:</b> You can use glob syntax for branch names.',
   
   branchwpStore: null,