correct error handling: groups and user permission can have the same name

This commit is contained in:
Maren Süwer
2018-09-25 09:22:31 +02:00
parent 225bb341d5
commit ab0f96db6b
2 changed files with 6 additions and 2 deletions

View File

@@ -82,7 +82,11 @@ class CreatePermissionForm extends React.Component<Props, State> {
currentPermissionIncludeName = () => {
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 false;