RCOSDP / RDM-osf.io

Facilitating Open Science
https://rcos.nii.ac.jp
Apache License 2.0
13 stars 24 forks source link

To prevent access if the user is not authenticated #355

Closed tma-ntphat closed 1 year ago

tma-ntphat commented 1 year ago

Fixed bug: check user permissions to prevent access if the user is not authenticated

Purpose

Fixed bug.

Changes

~Add permission definition permission_required = 'osf.view_osfuser', and add PermissionRequiredMixin to the inherited class list of the following View classes.~ Use the UserPassesTestMixin, and RdmPermissionMixin classes to check the permission of the authenticated users whose is_super_admin == True or is_admin == True

QA Notes

Documentation

Side Effects

Ticket

hide24 commented 1 year ago

User who is_staff == True and is_admin == False can not use this feature. I expect them to use this feature.

tma-ntphat commented 1 year ago

@hide24
I have checked it again.

I fixed it according to the following solution Use the UserPassesTestMixin, and RdmPermissionMixin classes to check the permission of the authenticated users whose is_super_admin == True or is_admin == True

Please help to check it. Thanks.

hide24 commented 1 year ago

Sorry and thank you. It's alright.