mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
correct error handling: groups and user permission can have the same name
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 for name already exists!"
|
"name-input-invalid": "Permission already exists!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,11 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
|
|
||||||
currentPermissionIncludeName = () => {
|
currentPermissionIncludeName = () => {
|
||||||
for (let i = 0; i < this.props.currentPermissions.length; i++) {
|
for (let i = 0; i < this.props.currentPermissions.length; i++) {
|
||||||
if (this.props.currentPermissions[i].name === this.state.name)
|
if (
|
||||||
|
this.props.currentPermissions[i].name === this.state.name &&
|
||||||
|
this.props.currentPermissions[i].groupPermission ==
|
||||||
|
this.state.groupPermission
|
||||||
|
)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user