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

can not go to /admin and "you are not admin" message flashes on screen before redirecting back to home. #3

Open
tomvolek opened this issue Sep 16, 2017 · 3 comments

Comments

@tomvolek
Copy link

After installing the package, If I try to go to /admin , I get the message "you can not view this page because you are not admin " . However if I hit the back button, I do get to /admin and can see all my collections.

The logged in user has a role admin , as I can test it with :
{{#if isInRole 'admin' 'default-group'}}

I am admin........


{{/if}}

However the same block of code in {{#if isinRole 'admin'}} does not return True. in file yadmin/lib/client/html/admin_layouts.html.

{{#if AdminConfig}} {{#if isInRole 'admin'}}

Any thoughts ?

@ignacy130
Copy link
Owner

The roles package used has groups of roles - see the link to understand it.

The message "you're not an admin" is shown here. You can see the exact checks which are executed.

I never experienced such behavior. It would be great if you could create simple repo with repro. Here is very simple demo you can start with.

@tomvolek
Copy link
Author

Ignacy: Exactly, the current user which is an Admin user gets checked at the above location you pointed out. However not sure why the check fails and it goes to the else clause which prints the message.
in my mediert.start() section , I explicitly do the following to make sure the admin user is indeed set to admin :
if (user.name === "tom" ){
Roles.addUsersToRoles(id, 'admin', 'default-group')
Roles.addUsersToRoles(id, 'super-admin', Roles.GLOBAL_GROUP)
}
however still going to /admin , i do see the message and then once i press browser back botton , i do see the admin panel.

What do you mean by saying "create simple repo with repro " .

By the way. Do you know if there is a way to decrease the input field length so to have few fields all on the same line ?

@ignacy130
Copy link
Owner

Sorry, by create simple repo with repro I mean creating a simple project and uploading it to GitHub for others to investigate. Or describing a clear way to reproduce the error.

I do see admin warning sometimes even if I am an admin, but it disappears after a second and I'm redirected to admin panel.

I guess you should override the template - please look at the aldeed:autoform documentation.

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