adding permissions

edited August 2006 in Vanilla 1.0 Help
what's the easiest way to add a new permission to a role? I can't seem to find a master list of permissions anywhere, looks like I have to tack it onto the text in the permissions column in LUM_Role but that just seems weird

Comments

  • MarkMark Vanilla Staff
    edited March 2006
    If you are using version 0.9.3, all permissions are serialized and stored in a single column. It was a handy way of (a) speeding up the query that pulls role permissions on every single page (so the app can know what you are allowed to see/do) and (b) allow you to add new permissions programmatically. To add a permission, you just specify a new permission in your conf file (or an extension file) with a prefix of PERMISSION_

    So, it would be like...

    $Context->Configuration['PERMISSION_DO_SOMETHING'] = '0';

    Which will create a new permission and make the default value "false". If you wanted the new permission to be granted to everyone by default, you'd specify 1 instead of 0.

    If you wanted to see where all other permissions are specified, take a look at the appg/settings.php file.
  • sweet thanks, I tried tracing it back through but never found where it was using Configuration
  • What's the procedure for doing this for an extension in 1.0?
  • still the same, like in this extension
  • Thanks, much obliged. :)
This discussion has been closed.