Closed tma-ntphat closed 1 year ago
User who is_staff == True
and is_admin == False
can not use this feature.
I expect them to use this feature.
@hide24
I have checked it again.
PermissionRequiredMixin
class and permission_required
attribute only work on the active superusers (self.is_active and self.is_superuser
or is_super_admin == True
)is_superuser == True
and is_super_admin == True
can use this feature because they have permissions.is_staff == True
and is_admin == True
can not use this feature because they have no permission.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.
Sorry and thank you. It's alright.
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 addPermissionRequiredMixin
to the inherited class list of the following View classes.~ Use theUserPassesTestMixin
, andRdmPermissionMixin
classes to check the permission of the authenticated users whoseis_super_admin == True
oris_admin == True
QA Notes
Documentation
Side Effects
Ticket