This commit is contained in:
@@ -186,14 +186,14 @@ namespace AyaNova.Api.Controllers
|
||||
if (!badRequest)
|
||||
{
|
||||
//check if object exists
|
||||
long attachToObjectOwnerId = attachToObject.OwnerId(ct);
|
||||
if (attachToObjectOwnerId == -1)
|
||||
{
|
||||
badRequest = true;
|
||||
errorMessage = "Invalid attach object";
|
||||
}
|
||||
else
|
||||
{
|
||||
// long attachToObjectOwnerId = attachToObject.OwnerId(ct);
|
||||
// if (attachToObjectOwnerId == -1)
|
||||
// {
|
||||
// badRequest = true;
|
||||
// errorMessage = "Invalid attach object";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// User needs modify rights to the object type in question
|
||||
if (!Authorized.IsAuthorizedToModify(HttpContext.Items, attachToObject.ObjectType, attachToObjectOwnerId))
|
||||
{
|
||||
@@ -202,7 +202,7 @@ namespace AyaNova.Api.Controllers
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
}
|
||||
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//is this allowed?
|
||||
if (!Authorized.IsAuthorizedToReadFullRecord(HttpContext.Items, dbObj.AttachToObjectType))
|
||||
if (!Authorized.HasReadFullRole(HttpContext.Items, dbObj.AttachToObjectType))
|
||||
{
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user