Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Unused Permissions Cleanup

edited January 2008 in Vanilla 1.0 Help
I would like to have an extension that went through all of the permissions, and eliminated the ones for which there is no extension / vanilla core that uses it (after verifying each one, of course). Edit: ... for when you enable an extension that requires a certain permission, so it adds it to the list, but when disabled, it doesn't delete its 'custom' permissions.

Comments

  • Options
    I think permissions are saved to the config file and I'm not sure if there's a function to remove them with the Vanilla API. I've only ever used AddConfigurationSetting and then, once there's a configuration option, I use AddPermission. Now I think about it though, I'm not sure why I need to use AddConfigurationSetting at all. Can someone clarify if this is still necessary? If not then new extensions probably won't leave permissions lying around and you can just edit conf/settings.php to delete the old ones.
  • Options
    hmm, this gets me thinking, for vanilla 2 (when that ever happens), each extension should have an optional file in addition to default.php, called clean.php it could be used to things like delete the databases it creates, and get rid of unused settings.
  • Options
    Mhm, perhaps setup.php and cleanup.php could be run when the extension is activated/deactivated.
  • Options
    But what if you want to temporarily disable an extension but keep some information for later reactivation?
    IMHO, cleanup.php shouldn't be run automaticly. Maybe make a link appear if there is a cleanup.php file, then ask for confirmation before effectively running it.
  • Options
    Yeah another good point. I would imagine cleanup.php would contain some type of database purger. If you wanted to retain that information then running cleanup.php on deactivate would be bad.
  • Options
    i had actually thought of that. i was thinking, in addition to activation there would be a "cleanup" button. also like the idea of setup.php have it run automatically when an addon is enabled. but only run once, until til cleanup has been clicked.
  • Options
    but in the meantime...
  • Options
    Another certain secret project of mine may have something to do with this...
  • Options
    mkay, i'll stop pestering people ....... i guess ... lol
This discussion has been closed.