add validation pattern for permission name

This commit is contained in:
Mohamed Karray
2018-09-26 14:03:08 +02:00
parent 538cd4fe72
commit 9b5848ea07
5 changed files with 28 additions and 9 deletions

View File

@@ -0,0 +1,12 @@
package sonia.scm.api.v2;
public class ValidationConstraints {
/**
* A user or group name should not start with the @ character
* and it not contains whitespaces
* the characters: . - _ are allowed
*/
public static final String USER_GROUP_PATTERN = "^[^@][A-z0-9\\.\\-_]|([A-z0-9\\.\\-_]*[A-z0-9\\.\\-_])?$";
}