Skip to content

optional method for controlling public access#332

Closed
CodeBlastr wants to merge 1 commit into
CakeDC:masterfrom
CodeBlastr:patch-1
Closed

optional method for controlling public access#332
CodeBlastr wants to merge 1 commit into
CakeDC:masterfrom
CodeBlastr:patch-1

Conversation

@CodeBlastr

Copy link
Copy Markdown

Please see the usage notes in the comments to see how this is a new optional method allows users to control public or guest access from the permissions.php config file. The benefit is that it allows all permissions to be controlled from a single place - including public permissions, as opposed to having some permissions in the individual controllers (eg. $this->Auth->allow('someAction')) and some permissions in the config file.

Please see the usage notes in the comments added to see how this is a new *optional* method allows users to control public or guest access from the permissions.php config file.  The benefit is that it allows all permissions to be controlled from a single place - including public permissions, as opposed to having some permissions in the individual controllers (eg. $this->Auth->allow('someAction')) and some permissions in the config file.
@steinkel

Copy link
Copy Markdown
Member

I see... yes, this could be a good improvement for people who wants to define all rules in the same place.
Instead of using '*' or 'public' I would add a new rule option like

 [
    'public' => true,
    'controller' => ['Pages'],
    'action' => ['other', 'display'],    
]];

Then we could match the controller in the component initialize to configure the controller's Auth->allow() with the extracted actions.

NOTE: Please send feature contributions to develop branch instead of master (I'll close this one and look forward to see your new PR)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants