mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 00:15:44 +01:00
do not allow @ names
This commit is contained in:
@@ -24,6 +24,6 @@
|
|||||||
"add-permission": {
|
"add-permission": {
|
||||||
"add-permission-heading": "Add new Permission",
|
"add-permission-heading": "Add new Permission",
|
||||||
"submit-button": "Submit",
|
"submit-button": "Submit",
|
||||||
"name-input-invalid": "Permission already exists!"
|
"name-input-invalid": "Permission is not allowed to start with an '@' or it already exists!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,10 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
label={t("permission.name")}
|
label={t("permission.name")}
|
||||||
value={name ? name : ""}
|
value={name ? name : ""}
|
||||||
onChange={this.handleNameChange}
|
onChange={this.handleNameChange}
|
||||||
validationError={this.currentPermissionIncludeName()}
|
validationError={
|
||||||
|
this.currentPermissionIncludeName() ||
|
||||||
|
this.state.name.startsWith("@")
|
||||||
|
}
|
||||||
errorMessage={t("add-permission.name-input-invalid")}
|
errorMessage={t("add-permission.name-input-invalid")}
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -73,7 +76,8 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
if (
|
if (
|
||||||
this.state.name === null ||
|
this.state.name === null ||
|
||||||
this.state.name === "" ||
|
this.state.name === "" ||
|
||||||
this.currentPermissionIncludeName()
|
this.currentPermissionIncludeName() ||
|
||||||
|
this.state.name.startsWith("@")
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ class Permissions extends React.Component<Props> {
|
|||||||
{t("permission.group-permission")}
|
{t("permission.group-permission")}
|
||||||
</th>
|
</th>
|
||||||
<th>{t("permission.type")}</th>
|
<th>{t("permission.type")}</th>
|
||||||
|
<th />
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user