I've created some modules which work well, but I the permissions I've created for them don't seems to work. Only the super user account can manage modules. I've followed the tutorial on
http://docs.getfuelcms.com/modules/tutorial#permissions and assigned the permissions to a user. I can think I'm naming the permission correctly because when the permission is created, four sub-permissions are also created (create, delete, edit, publish). The steps in the tutorial are a bit lacking, if someone who has module permisssions working could give me a few tips, that would be great. Thanks!
Comments
php index.php fuel/generate/simple meetings
http://docs.getfuelcms.com/modules/generate
The URI shouldn't the view that publicly shows the model, rather if your admin dashboard is at "mysite.com/fuel/dashboard" then the URI for a module called "Meetings" would be "meetings". Similarly, for a permission to edit the Meetings module, the URI would be "meetings/edit". Capitalization counts.
"You do not have permissions to complete this action."
I tried to track it down in the FUEL core files a bit and here's what I've found:
- in the Fuel_auth->has_permission( ) method, the $user_perms variable does contain the meetings/create permission:
array (size=4)
'id' => string '37' (length=2)
'description' => string 'Meetings: Create' (length=16)
'name' => string 'meetings/create' (length=15)
'active' => string 'yes' (length=3)
but, the $permission argument that gets passed in does not contain the meetings/create permission:
$permission =
array (size=3)
'edit' => string 'meetings' (length=8)
'publish' => string 'meetings_publish' (length=16)
'delete' => string 'meetings_delete' (length=15)
(so, then it's obviously this line:
return (!empty($permission) AND !empty($user_perms[$permission]));
that returns false and causes the user to "not have permission" to view the meetings/create page)
I tracked down the mysql query that generates $user_perms, but I can't seem so find where the $permission variable originates from. Any idea why $permission would be lacking the 'create' permission but the $user_perms has it?
Thanks!