dre1080/warden — Issue #18: Can not login after changing user role relation in the database
Author: webstone
Created: 2012-02-17 20:19:06+00:00
State: open

Hi,

i have login problems after changing the role id in the table "roles_users".

In my configuration is the default role "User" (id:1).
I create two users and they are linked to the role with the id "1" as defined.
Now i played a bit with the roles and the permissions and created via phpmyadmin some test records
for each tables and linked the roles and permissions in the table "roles_permissions".

Now I tried to set the new role for the user "test" (id: 16) and open the table "roles_users"
and changed the value for "role_id" from "1" to "3"…

Then i logged out and tried to login again… but it doesn't work.
I become a flash message "Logged in successfully" but i'm not logged in.

But if I change the value back to "1" i'm logged in.

I don't know what is wrong but i'm a bit confused :-/

I have searched in the fuelphp forum about several problems but i can't found anything.
In the documentation I can't find also anything about changing the user role for an user.

Is there any function to set a new role for an user or any workaround to fix this problem?

Here my structure for steps to reproduce.
If you need more information, let me know it.

table: roles

id	name
1	User
2	Member
3	Editor
4	Admin

table: permission

id	name	resource	action
4	news - create	news	create
5	news - update	news	update
6	news - delete	news	delete
8	pages - create	pages	create
9	pages - update	pages	update
10	pages - delete	pages	delete
11	users - create	users	create
12	users - update	users	update
13	users - delete	users	delete
14	plantago - create	plantago	create
15	plantago - update	plantago	update
16	plantago - delete	plantago	delete
17	plantago - download	plantago	download
18	user - moderate	user	moderate

table: roles_permissions

role_id	permission_id
3	4
3	5
3	6
3	14
3	15
3	16
2	17
3	17
3	18

table: roles_users

role_id	user_id
3	16
1	17

table: users

id	username
16	test
17	admin