Skip to content

wenbert/Pwede

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pwede

An access permission plugin for CakePHP. Permission management is centralized. Provides a UI to manage permissions.

Component Dependencies

This plugin relies on the Auth component enabled (see below). Make sure you have the Auth component setup and the 'authorize' parameter set to 'Pwede.Pwede'

Usage

Enable the plugin with bootstrap set to true.

CakePlugin::loadAll(array(
    'Pwede' => array('bootstrap' => true)
));

Add in your components:

public $components = array(
    'RequestHandler',
    // 'Acl',
    'Auth' => array(
        'authenticate' => array(
            'Form' => array(
                'fields' => array(
                    'username' => 'username',
                    'password' => 'password',
                ),
                'userModel' => 'User',
                'contain' => array('Group','Group.Pwederesource'),
                'recursive' => -1,
            )
        ),
        'loginAction' => array(
                'plugin' => 'user_manager',
                'controller' => 'users',
                'action' => 'login'
        ),
        'logoutRedirect' => array(
                'plugin' => 'user_manager',
                'controller' => 'users',
                'action' => 'login'
        ),
        'authorize' => array(
            'Pwede.Pwede',
        )
    ),
    'Session',
    'Security' => array(
        'csrfUseOnce' => false
    ),
    'Pwede.Access' => array(
        'user_model' => 'UserManager.User',
        'group_model' => 'UserManager.Group',
        'group_model_fk' => 'group_id'
    )
);

WHERE

The Group Model 'group_model' => 'UserManager.Group'

The Foreign Key 'group_model_fk' => 'group_id',

Make sure your User model has:

public $actsAs = array(
    'Containable',
);

About

An authorization plugin for CakePHP. Permission management is centralized. Provides a UI to manage permissions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages