A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; MarkdownExtraExtended_Parser has a deprecated constructor

Filename: helpers/markdown_extended_helper.php

Line Number: 10

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Markdown_Parser has a deprecated constructor

Filename: helpers/markdown_helper.php

Line Number: 223

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; MarkdownExtra_Parser has a deprecated constructor

Filename: helpers/markdown_helper.php

Line Number: 1696

Docs - My Bonfire

Permissions for Developers

Initializing the Model

Like most other models in CodeIgniter, the Permission Model is initialized in your controller by using the $this->load->model function:

$this->load->model('permissions/permission_model');

Once loaded, it will be avialable by using $this->permission_model.

Basic Usage

The role model extends from BF_Model, providing all of the default features of that model. In addition, the following methods are provided.

delete_by_name()

A convenience method that deletes the role by name, instead of the more common 'id'. This is very handy during migrations when you don't know what ID has been assigned to it, but you do the name.

$this->permission_model->delete_by_name('Site.Content.View');

permission_exists()

Checks the database to see if a permission already exists. Simply a more descriptive version of the is_unique method. The only parameter is the name of the permission.

if ($this->permission_model->permission_exists('Site.Content.View')) { . . . }