Open
Description
Most (but maybe not all) REST views use permissions defined in alyx.base.BestRestPublicPermission
:
Lines 648 to 664 in 95c2e40
alyx.base.BaseAdmin.has_change_permission
method: 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:
- 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.