You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, the question is: should we return the real TestCase object or a modified one?
This is actually a very interesting question for the popcorn framework, maybe @ppepos will be interested.
In some cases, when serializing an object to the API, we do not want to return the full object as some data can be private or with a restricted access.
Examples:
lists of player submission that is not self
player score that is not self or a friend
private test inputs
...
How can we provide a kiss serialization mechanism with right handling?
From what I remember from the discussion with @ppepos on a related problem, here my proposal for a quick and dirty workaround:
by default, all data are marked as public
we use an annotation to mark restricted data and give them an arbitrary right level ():
classUser# Public stringvarname: String# Restricted to self (and admins):varemail: Stringisrestricted(self)
# Restricted to self and friends:varscore: Intisrestricted(friends)
end
And then, the JSON serialization process will take out restricted data depending on a user (lot of code to handle annotations required but somehow a clean an unified process?).
The text was updated successfully, but these errors were encountered:
For now, all the test cases are public since they are returned by the API:
For each submission we can see the provided inputs:
So, the question is: should we return the real TestCase object or a modified one?
This is actually a very interesting question for the popcorn framework, maybe @ppepos will be interested.
In some cases, when serializing an object to the API, we do not want to return the full object as some data can be
private
or with a restricted access.Examples:
How can we provide a kiss serialization mechanism with right handling?
From what I remember from the discussion with @ppepos on a related problem, here my proposal for a quick and dirty workaround:
public
restricted
data and give them an arbitraryright level
():And then, the JSON serialization process will take out restricted data depending on a user (lot of code to handle annotations required but somehow a clean an unified process?).
The text was updated successfully, but these errors were encountered: