Skip to content

Conversation

@dereuromark
Copy link
Owner

@dereuromark dereuromark commented Oct 19, 2016

Added:

  • option for multiple INI files
  • AuthUserHelper
  • Speed test for link methods, they are basically as fast as normal Html::link() and Form::postLink().

Also:

  • Moved common logic into a trait
  • Removed deprecations

Can be released as 1.6

TODO:

  • AuthUserComponent and AuthUserHelper for basic hasAccess($url) and hasRole() isMe() etc

@dereuromark dereuromark changed the title Add option for multiple INI files, add AuthHelper. Add option for multiple INI files, add AuthUser component and helper Oct 20, 2016
@dereuromark
Copy link
Owner Author

Please feel free to give feedback! I will merge the develop already in master for now to allow further improvements there then.
See also http://sandbox.dereuromark.de/auth-sandbox as a live preview of the current state.

@dereuromark dereuromark merged commit 3f822ec into master Oct 21, 2016
@dereuromark dereuromark deleted the develop branch October 21, 2016 15:48
Copy link
Contributor

@saeideng saeideng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for added this changes

return $roles;
}

return $roles;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between this and above return?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method got refactored afterwards already.

$controller = $event->subject();

$authUser = (array)$this->user();
$controller->set('_authUser', $authUser);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we wrote own beforeRender Event in our app area?
Do we need to write (set _authUser) in our app?

* @param array $options
* @return string
*/
protected function _default($title, $options) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing docs

]);

$user = ['id' => 1, 'role_id' => 999];
$user = ['id' => 1, 'role_id' => 1];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?
below assertTrue() trace the "id" in this sample, and not role_id ,even we can remove it(role_id)
999 means we can use any value for it

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to clean things up a bit with a PR. Much appreciated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returned Cannot find role alias for role 999
see below comment

$alias = array_keys($availableRoles, $role);
$alias = array_shift($alias);
if (!$alias || !is_string($alias)) {
throw new RuntimeException('Cannot find role alias for role ' . $role);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about this
we would just return false for using in cakephp auth

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worried in what way?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably this make BC issue (i'm not sure now)

maybe some one needs to use just super admin without roles
and maybe some another usage of this plugin

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened PR #46

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants