Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Can a normal user manage module contents?

edited February 2011 in Modules
I've created a simple module called "News" where I can create news items from the admin. On the public site: the news items are listed in a single page (/news), each with a link to its own page (/news/$id). However, I can't seem to create a normal user (with non-admin permissions) that has access to this module? The idea is to let the fictional client add/edit news items on the site.

Am I missing something?

Thanks.

Comments

  • edited 6:18PM
    hi Cravr,

    i believe you need create permission for news module and assign the permission to normal user in order to access the news module.

    another things is you need to load the module with the permission config

    $config['modules']['news'] = array('permission' => 'news',);

    p/s admin please correct if i m wrong
  • edited 6:18PM
    knight: Thanks for your answer, I had the same problem as cravr and I was waiting for someone to answer it. I also forgot to create "news" record in permission section. Now it works...
  • edited 6:18PM
    Thanks knight... you are correct. By default, the permission parameter will be set to your module key (e.g. news), so technically you don't need to specify it unless it's different.
  • edited 6:18PM
    Hi knight, admin,

    Thanks for your responses. I'm afraid I still don't fully understand what I need to do. I've updated the MY_fuel_modules.php file with this:

    $config['modules']['news'] = array(
    'preview_path' => 'news/{id}',
    'permission' => 'news'
    );

    Admin, as you said, I wouldn't need to specify the above permission pair as the default is 'news' anyway.

    But I still can't see the News module in the Permissions list in the admin?

    Thanks again.
  • edited February 2011
    Is the permission created? To create a permission, you need to select Permissions on the left and enter in a permission with the key of "news". Then you need to associate the user to that permission.
  • edited 6:18PM
    Got it, thanks!
Sign In or Register to comment.