Open dpkass opened 3 months ago
We should preferably use User with id 2 or 3, as they have also done some corrections.
We could also create dummy data for a new user - automatically or after a button press.
Some tests depend on the ids of the dummy data though.
Jup, I've seen the data and I don't want to mess with that. I was thinking I could simply substitute the new users id, when starting in dev mode. If that unnecessarily complects dev with login etc. I will just generate data for a new user.
Something like running with profiles would be great. Then we would just write one main and depending on the profile it chooses not just the main function, but also already sets the user and the dummy data.
I am thinking about using a utility function or macro, which will be used as a check, handing in the actual check function. We could later use the same function for admin permissions.
I am thinking about using a utility function or macro, which will be used as a check, handing in the actual check function. We could later use the same function for admin permissions.
I do not quite understand what this means, can you elaborate?
To make the dummy data visible in dev mode I can simply disable all permission checks. I would do that with one utility function, that simply returns true, if the only error is a permission error.
I am not sure how feasible that is, and how the error structure is currently comprised. If we only have an error message and no code type of thing it might actually not be best to do it this way.
On the other hand, since we need to set up roles anyways, I could make a feature ticket for improved error handling using error codes.. Then our error HTTP responses could also be improved to actual error codes like unauthorized, not found etc.
To have a simpler setup, when running dev-server to check how implemented changes effected the website, we should make our new user one of the 3 dummy users.
Further investigation is needed to check how to circumvent default user creation.