I have the following code on my system for quite some time, after upgrading to StartSharp it is no longer working.
@volkanceylan , how do I get the UserId on the client side?
private permiteAlteracao(note: NoteRow) {
if (note.InsertUserId != Authorization.userDefinition.UserId) {
Q.alert("Ops! N茫o 茅 poss铆vel alterar ou excluir anota莽茫o de outro usu谩rio!");
return false;
}
return true;
}

Update your class ScriptUserDefinition.cs
Add a new property UserId into it.
Update your function public ScriptUserDefinition GetUserData()
Assign the UserId value from UserDefinition.Id into that new property
@Febriantos, I thought about it, but why did @volkanceylan remove it?
Is this what I want to do differently?
If I add this property again, will it go wrong at another point in the system?
You should perform such checks at repository, not client side. Don't depend on any clientside information.
Hi @adalberto-argente
For checks I agree with Volkan - only on the server side you have full control.
But there are other scenarios - e.g. when using the CloneEntity on client-side and you want to set for example who has done the cloning directly while cloning - then you want to have the user Id on client-side and in such a scenario, @Febriantos suggestion makes much sense.
With kind regards,
John
Most helpful comment
Update your class ScriptUserDefinition.cs
Add a new property UserId into it.
Update your function public ScriptUserDefinition GetUserData()
Assign the UserId value from UserDefinition.Id into that new property