1
roarjo
News permissons
  • 2004/3/1 17:32

  • roarjo

  • Just popping in

  • Posts: 8

  • Since: 2004/3/1 1


Hi all

I have a question. The news module that came with XOOPS 2.0.6. Is it possible to set permissions for "submit news" only to admin's? And not all registred users?

I Want registered users to be able to read the news but not to publish. If not are there other modules that has that feature?

Or have I missed something ?

--
Best Regards
Roar

2
Mithrandir
Re: News permissons

Next version of News module.

The feature you request is already implemented albeit it still needs a bit of tweaking to fully utilise the group permissions core feature.

We are also working on putting loads of other things into the module, so it can really be of use to any site out there without the need for additional modifications, so do be patient.

3
JackJ
Re: News permissons
  • 2004/3/1 22:24

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


Hello roarjo,

Yes, meantime you can hide the submit sub-menu and make it available to admins only, or registered users only. Go to xoops_version.php in the root of your News folder, and look for the menu code. Two examples below

//Submenu for admin submit only

// Menu
$modversion['hasMain'] = 1;
global $xoopsUser;
if ( $xoopsUser ) {
$newsModule = XoopsModule::getByDirname("news");
if ( $xoopsUser->isAdmin($newsModule->mid()) ) {
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";
}
}
$modversion['sub'][2]['name'] = _MI_NEWS_SMNAME2;
$modversion['sub'][2]['url'] = "archive.php";


//Submenu for groups ie reg users only

// Menu
$modversion['hasMain'] = 1;
global $xoopsUser;
if(!empty($xoopsUser)) {
$group = $xoopsUser->getGroups();
if (in_array(2, $group)) { //or other group-IDs group 2 is reg users
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";
}
}
$modversion['sub'][2]['name'] = _MI_NEWS_SMNAME2;
$modversion['sub'][2]['url'] = "archive.php";

4
roarjo
Re: News permissons
  • 2004/3/2 6:57

  • roarjo

  • Just popping in

  • Posts: 8

  • Since: 2004/3/1 1


Hi..

Thanks alot. That worked like a dream..

--
Best Regards
Roar

Login

Who's Online

93 user(s) are online (38 user(s) are browsing Support Forums)


Members: 0


Guests: 93


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits