I was thinking about that new feature which allows some gadgets to be hidden from [[Special:Preferences]] in the case the user doesn't have certain specific privileges. Consider the following gadget definition:
(for documentation of this gadget, see [[meta:User:Pathoschild/Scripts/Ajax sysop]]). Although the gadget require all indicated privileges to be fully functional, some users could benefit of parts of it even if they don't have all the required permissions.
So, I was wondering if it would be possible to define "parts" of the gadgets which would be loaded or not depending on whether the user has a specific right or not. This way, if a user is able to "patrol" but not to "delete", it could still use the script, although only the parts which are usable without the missing rights.
Maybe an option to achieve this would be the possibility of associating rights to specific ".js" pages instead of (or in addition to) the whole gadget module. E.g.:
- Ajax_sysop[ResourceLoader]|Main code.js[rights=rollback,delete]|optional stuff.js[rights=patrol,markbotedits]