Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Forbidden (#403) for Administration #123

Open
elkrari opened this issue Jun 11, 2017 · 11 comments
Open

Forbidden (#403) for Administration #123

elkrari opened this issue Jun 11, 2017 · 11 comments

Comments

@elkrari
Copy link

elkrari commented Jun 11, 2017

Hi!
I don't have access to the forum settings (Administration) with my admin account.
I a first time the "Administration" element in the navbar doesn't appear. I checked out a previous issue (N° 94) and corrected the user_id in podium_auth_assignment table. Now the "Administration" element appear but still don't have right access.

@bizley
Copy link
Owner

bizley commented Jun 11, 2017

Try to flush the cache.

@elkrari
Copy link
Author

elkrari commented Jun 11, 2017

Still Forbidden...

@bizley
Copy link
Owner

bizley commented Jun 11, 2017

In your previous post configuration adminId is 1 - is it still the case?
Can you tell me what are the values of following fields in your database:

  • podium_auth_assignment - itemName, user_id (assuming it's only one row),
  • podium_user - id, inherited_id (same here).

@elkrari
Copy link
Author

elkrari commented Jun 11, 2017

It was just an example. Indeed, IDs in my user table are usernames (varchar(64)), so adminId is 'elkrari'. I already altered the table to change inherited_id type.

  • podium_auth_assignment itemName = "podiumAdmin" and user_id = 1
  • podium_user id = 1 and inherited_id = "elkrari"

@bizley
Copy link
Owner

bizley commented Jun 11, 2017

This is unusual. Now I'm not sure if Podium is prepared to handle non-numeric keys for users...
BTW If your primary key for user table is varchar why have you set adminId as 1?

Anyway - try to set user_id in podium_auth_assignment to "elkrari".

@elkrari
Copy link
Author

elkrari commented Jun 11, 2017

As I said earlier,

It was just an example. ... adminId is 'elkrari'.

Podium set in the beginning user_id in podium_auth_assignment to "elkrari" and I didn't work. even "Administration" element in the navbar doesn't appear until I changed it to 1.
I did now another try and the element disappeared again (with the value "elkrari").

inherited_id in the User model has been changed to string and to VARCHAR in the database table.

@bizley
Copy link
Owner

bizley commented Jun 11, 2017

In your app when you call echo Yii::$app->user->id; (being logged as "elkrari") what do you get? Have you flushed the cache again after change?

@elkrari
Copy link
Author

elkrari commented Jun 11, 2017

My primary key in the table is "login" not "id".
I can't use the "flush cache" option because I don't have right access. I just cleaned my browser cache.

@bizley
Copy link
Owner

bizley commented Jun 12, 2017

echo Yii::$app->user->id; should work no matter what the primary key name is (if your User model is properly constructed).
Browser cache is not enough. I can see in your config that you are using file cache so just remove cache files from runtime/cache folder.

@elkrari
Copy link
Author

elkrari commented Jun 12, 2017

Yii::$app->user->id showed "elkrari".
I removed cache files related to Podium but nothing changed.

@eLFuvo
Copy link

eLFuvo commented Jun 24, 2017

See this issue #115
Maybe user access rights is getting wrong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants