fix(postit): preserve performer identity during save
This commit is contained in:
parent
008295c8f6
commit
5e22b9a232
3 changed files with 78 additions and 24 deletions
|
|
@ -228,7 +228,17 @@ namespace Yavsc.WebApi.Controllers
|
|||
}
|
||||
|
||||
var uid = User.GetUserId();
|
||||
if (string.IsNullOrWhiteSpace(uid) || !string.Equals(model.PerformerId, uid, StringComparison.Ordinal))
|
||||
if (string.IsNullOrWhiteSpace(uid))
|
||||
{
|
||||
return Challenge();
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(model.PerformerId))
|
||||
{
|
||||
model.PerformerId = uid;
|
||||
}
|
||||
|
||||
if (!string.Equals(model.PerformerId, uid, StringComparison.Ordinal))
|
||||
{
|
||||
return Forbid();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue