nnseva / django-access

Django-Access - the application introducing dynamic evaluation-based instance-level (row-level) access rights control for Django
GNU Lesser General Public License v3.0
77 stars 6 forks source link

Constant instead of callable check #10

Open nnseva opened 5 years ago

nnseva commented 5 years ago

The simplest way to check rights is to return constant value, f.e. True, False, or {}. In case of constant grant type, the code should be allowed to look like:

        ApplyAblePlugin(
            changeable=False,
            deleteable=False,
        ),

instead of

        ApplyAblePlugin(
            changeable=lambda queryset, request: False,
            deleteable=lambda queryset, request: False,
        ),