ARETEedu / moodle-mod_arete

A repository service for Augmented Reality Learning Experience Models (compliant with IEEE p1589-2020)
GNU General Public License v3.0
3 stars 2 forks source link

User activities filtered by userid #94

Closed MariellaF closed 1 year ago

MariellaF commented 2 years ago

A server side method is needed to obtain the list of userid user activities. So we need a rest method to be called with a userid parameter that returns a json with the list of the ONLY activities of the userid user. In fact, in several cases is useless to obtain a complete list of all users activities and then filter locally by userid.

Callustian commented 2 years ago

@fwild Hello. I suggest that we implement this feature giving the possibility of specifying a "public" flag to the POST request. Given that a token is provided, if the flag passed has "1" value or the flag is not passed, the endpoint should returns public activities and also activities private to the userid passed, as the endpoint it is doing at this time. If the flag is specified has "0" value, then I suggest that we would return only the activities public and private to the userid passed.

fwild commented 2 years ago

Makes sense!

fwild commented 2 years ago

If the request is started by someone with admin privileges, then it should return private and public resources, otherwise only public resources!

fwild commented 2 years ago

e.g. via URL parameter "filter_by_userid=pasquale*"

Callustian commented 1 year ago

@fwild I have reused the userid instead of adding a parameter as the id of the user that is making the request is the user that sends the token.