[Profile] Allow grantRole to work when role exists

Esse commit está contido em:
Alexei Sorokin
2020-08-11 15:00:57 +03:00
commit 15f7941daf
+4 -1
Ver Arquivo
@@ -1162,7 +1162,10 @@ class Profile extends Managed_DataObject
$role->role = $name;
$role->created = common_sql_now();
$result = $role->insert();
$result = $role->update();
if ($result === 0 || $result === false) {
$result = $role->insert();
}
if (!$result) {
throw new Exception("Can't save role '$name' for profile '{$this->id}'");