I'm trying to add some info to the data result whether the user has read or write access to the entity.
Lets assume I have this entity:
public class Foo
{
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Access> AccessRights { get; set; }
}
Where AccessRights
holds the user id and if they have read/write access.
Currently I just $expand
AccessRights and calculate if the user has read/write access in the frontend. However I'd like this calculated property to be added to the result.
Example json result:
{
id: 1,
name: "foo",
hasReadAccess: true,
hasWriteAccess: true
}
Is it possible to do this? Keep in mind that HasRead/WriteAccess
doesn't exist on the model nor should it.