Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unauthorized action Error on generated pages #29

Open
jaydombroski opened this issue Jan 18, 2017 · 3 comments
Open

Unauthorized action Error on generated pages #29

jaydombroski opened this issue Jan 18, 2017 · 3 comments

Comments

@jaydombroski
Copy link

First off, thank you for all the hard work to make this script!

I have followed your intrustions to the "T" and when I go to look at /admin/users, /admin/permissions or /admin/roles I get the following:

HttpException in Application.php line 917:
Unauthorized action

I did update in the config to use /admin, but other than that, very stock. The user I am logging in with, is a admin, as I have tested using Tinker, and was able to confirm.

Any advice would be helpful.

Thank you,

Jay

@acoustep
Copy link
Owner

acoustep commented Jan 18, 2017

Hi @jaydombroski,

Could you let me know what version of Laravel you're using, and what your config file looks like?

As a long shot: is the admin role spelt the same in the middleware-role config as in your database (including capitalisation)?

@jaydombroski
Copy link
Author

jaydombroski commented Jan 18, 2017

hi @acoustep

Laravel 5.3

entrust-gui.php:

return [
"layout" => "entrust-gui::app",
"route-prefix" => "admin",
"pagination" => [
"users" => 5,
"roles" => 5,
"permissions" => 5,
],
"middleware" => ['web', 'entrust-gui.admin'],
"unauthorized-url" => '/login',
"middleware-role" => 'admin',
"confirmable" => false,
"users" => [
'fieldSearchable' => [],
],
];

mysql> select * from roles;
+----+-------+--------------------+------------------------------------------------+---------------------+---------------------+
| id | name | display_name | description | created_at | updated_at |
+----+-------+--------------------+------------------------------------------------+---------------------+---------------------+
| 1 | admin | User Administrator | User is allowed to manage and edit other users | 2017-01-18 18:48:46 | 2017-01-18 18:48:46 |
+----+-------+--------------------+------------------------------------------------+---------------------+---------------------+
1 row in set (0.00 sec)

@jaydombroski
Copy link
Author

jaydombroski commented Jan 18, 2017

As a follow up,

I can even do a check in a blade:

@ROLE('admin')
this is admin
@Endrole

And "this is admin" is printed out

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

No branches or pull requests

2 participants