-
Notifications
You must be signed in to change notification settings - Fork 5
feat/AB#106951_EIS-user-activity-permissions #1169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: alpha
Are you sure you want to change the base?
feat/AB#106951_EIS-user-activity-permissions #1169
Conversation
- Renamed the `Activity` model to `ActivityLog`. - Updated all references in routes and queries. - Added new GraphQL queries for fetching activity logs. - Adjusted metadata handling in the GraphQL type definition.
Changed userId from string to mongoose ObjectId in the activity log model. Updated related route to use _id instead of id for consistency.
- Changed column definitions to include titles and fields. - Added data formatting for userId, eventType, and metadata. - Updated XLSX generation to use formatted data instead of raw activities.
AB#106578 --------- Co-authored-by: Antoine Hurard <antoine@reliefapplications.org>
AB#106561 --------- Co-authored-by: Antoine Hurard <antoine@reliefapplications.org>
feat: add user read permission check for activity download and activity logs fetch
@AntoineRelief Just to check with you that im on the right path with what I currently did, as I think I never worked on the permission side of the application yet.
And use the found ids as a match for filtering the related activityLogs(if use has not global permissions of course) If possible let me know, thanks |
I don't think we should do it this way You can check the: extendAbilityForApplications method in the back, that check permission for a single app if you find an application id in the query, you can use it |
feat: check if current user has permission for given application or global permissions to be able to fetch and download the specific activities
@AntoineRelief I changed the logic based on the extendAbilityForApplications. What i dont have clear is how or where the error should be raised if no permission is suitable. Keeping this in draft until #1164 is merged and contains the applicationId in the metadata property KR, Unai |
Description
feat: add user read permission check for activity download and activity logs fetch
Useful links
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Screenshots
Please include screenshots of this change. If this issue is only back-end related, and does not involve any visual change of the platform, you can skip this part.
Checklist:
( * == Mandatory )
More explanation
https://www.loom.com/share/05a716d61b9744faaf51fb304c21d1e5?sid=f87cf896-582a-4f76-93ae-8ceed801b145