|
@@ -265,6 +265,10 @@ public class RolePrivilegeController extends ControllerSupport {
|
|
|
privilege.setCode(privilege.getCode().trim());
|
|
|
privilege.setDescription(privilege.getDescription());
|
|
|
|
|
|
+ if (!privilege.getCode().matches("[0-9a-zA-Z_]+")) {
|
|
|
+ throw new StatusException("B-020101", "权限编码必须由字母,数字和下划线组成");
|
|
|
+ }
|
|
|
+
|
|
|
PrivilegeGroupEntity group = privilegeGroupRepo.findOne(privilege.getGroupId());
|
|
|
if (null == group) {
|
|
|
throw new StatusException("B-020001", "权限组不存在");
|