Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 783
  • Dot Hidden: 0
  • Dot Users: 1
  • Dot Users Online:

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Article Removed

Started by peteewheat, October 31, 2009, 07:45:47 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

peteewheat

Using SMF2.0 RC1.2
SP2.3.1
Internal site

I want to allow users to add articles, pending my approval before they are published. I can set this up ok with just checking the permissions box for adding an article. However, this box allows anyone with this permission checked to delete any article, without requiring approval.

It seems to me this should be seperated (permissions check for add article, remove article, requiring approval, etc. I don't ever want any of my members deleting articles.   Am I doing something wrong?

Nathaniel

Currently, the 'Remove Articles' button/task requires the 'Can Add Article' permission, a 'Can Remove Article' permission would be useful, although it makes sense for users with the 'Administrate portal' or the 'Manage portal articles' permissions to be able to remove articles.

Reported this issue to the Project tracker.
Bug report for bad permissions checking:
http://simpleportal.net/index.php?issue=309.0
Feature request for 'Can Remove Article' permission:
http://simpleportal.net/index.php?issue=310.0
Also found an issue with a deprecated permission:
http://simpleportal.net/index.php?issue=311.0

For now, the edits below, will allow users to remove articles, only if they have either the 'Administrate portal' or the 'Manage portal articles' permissions. (it fixes the bug)
Code ("Find (sources/PortalArticles.php)") Select
if (!allowedTo('sp_add_article') && !allowedTo('sp_moderate'))
fatal_lang_error('error_sp_cannot_remove_article');


Code ("Replace") Select
if (!allowedTo('sp_admin') && !allowedTo('sp_manage_articles'))
fatal_lang_error('error_sp_cannot_remove_article');


Code ("Find (sources/Subs-Portal.php)") Select
if (!empty($context['current_topic']))
$context['can_make_article'] = allowedTo(array('sp_admin', 'sp_manage_articles', 'sp_add_article'));


Code ("Replace") Select
if (!empty($context['current_topic']))
{
$context['can_make_article'] = allowedTo(array('sp_admin', 'sp_manage_articles', 'sp_add_article'));
$context['can_remove_article'] = allowedTo(array('sp_admin', 'sp_manage_articles'));
}


Code ("Find (Themes/default/Display.template.php)") Select
if ($context['can_make_article'])

Code ("Replace") Select
if ((!$context['topic_is_article'] && $context['can_add_article']) || ($context['topic_is_article'] && $context['can_remove_article']))
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

peteewheat

Thanks for the quick response! Works great with one minor hiccup. I couldn't add articles any more.

I changed:
Code (Themes/default/Display.template.php) Select
if ((!$context['topic_is_article'] && $context['can_add_article']) || ($context['topic_is_article'] && $context['can_remove_article']))

to:
Code (Themes/default/Display.template.php) Select
if  ((!$context['topic_is_article'] && $context['can_make_article']) || ($context['topic_is_article'] && $context['can_remove_article']))

Hopefully I did that right. So far, it seems to be working.

Nathaniel

Yep, that looks good, made a type in my post. :)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.