Skip to content

Conversation

@bctiemann
Copy link
Contributor

Fixes: #20490

Adds the ability to filter Scripts based on custom object-level permissions with constraints such as:

    {
        "name__in": [
            "MyScript"
        ]
    }

Note that this permission is applied against Script objects, allowing permissions to be applied against Script or ScriptModule objects via ORM lookups; however, access to the overall Scripts page is given via the ManagedFile object type.

@bctiemann bctiemann requested review from a team and jeremystretch and removed request for a team January 18, 2026 22:28
Custom scripts have unrestricted access to change anything in the database and are inherently unsafe and should only be installed and run from trusted sources. You should also review and set permissions for who can run scripts if the script can modify any data.

!!! tip "Permissions for Custom Scripts"
A user can be granted permissions on all Custom Scripts via the "Managed File" object-level permission. To further restrict a user to only be able to access certain scripts, create an additional permission on the "Script" object type, with appropriate queryset-style constraints matching fields available on Script. For example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems very confusing, as "script module" appears as an available object type in the permission form. I don't think we should rely on the ManagedFile model for permissions here, as it's not intended to be a "public" model. Or, if we can't get permissions to work using ScriptModule (a proxy model), we should remove it from the list of available models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not display scripts in the scripts list view if the user does not have permission to view them

3 participants