You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Add the responsible user or user(s) to the list of allowed users.
ifhasattr(obj, 'responsible_user'):
allowed.add(obj.responsible_user)
ifhasattr(obj, 'user'):
allowed.add(obj.user)
ifhasattr(obj, 'users'):
foruserinobj.users.all():
allowed.add(user)
returnrequest.userinallowed
This means that users have far more permissions when making REST queries than via the admin interface which is extremely insecure and confusing to users. Below are some suggested improvements:
Ensure all REST views are using a shared base permissions set (i.e. permission_classes = rest_permission_classes() is present everywhere)
Ensure all model admin classes use the same basic permissions system (i.e. super class call to BaseAdmin.has_change_permission)
Consolidate base permissions between APIs (the above two methods can call a common base permissions function)
Permit test Alyx to allow all REST permissions for testing purposes - check library tests still pass after changes
Add method to BaseTests to check that REST API permissions are suitable. This can be a generic test for all apps.
The text was updated successfully, but these errors were encountered:
Most (but maybe not all) REST views use permissions defined in
alyx.base.BestRestPublicPermission
:alyx/alyx/alyx/base.py
Lines 648 to 664 in 95c2e40
alyx.base.BaseAdmin.has_change_permission
method:alyx/alyx/alyx/base.py
Lines 374 to 413 in 95c2e40
This means that users have far more permissions when making REST queries than via the admin interface which is extremely insecure and confusing to users. Below are some suggested improvements:
permission_classes = rest_permission_classes()
is present everywhere)BaseAdmin.has_change_permission
)The text was updated successfully, but these errors were encountered: