Hi again Tom !
Sorry I ask a lot of questions 😅
I was wondering how I could implement a more granular permission system where a user can have different roles at different levels - for example, being an admin at the org level but only a member for a course and an admin for another one within that workspace. First I would have to create another action GetCourseAbilities
and create "rules" like we did for GetOrganizationAbilities
.
My problem is to understand how to modify the middleware to get the roleId associated to the course. Since we only get the roleId for the workspace. Should I create a middleware that specifically check the ctx.params
to retrieve the course.id
and find the user's role like we do in the workspace_middleware
?
I should have tested it before asking you, but I have analysis paralysis and I'm not sure this is the best and cleaner idea.
Also I was wondering how we can check more things than just the user's role for an organization's ability. For example, canceling an invite. An admin user can cancel all invites, but a member user cannot remove invites, unless he's the one who made the invite. Tried multiple things here but none of them is working. I think I didn't understand very well how things work 😅