TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,993
  • Total Topics: 21,324
  • Online today: 296
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 255
  • Total: 255

Editing Articles

Started by wylek, September 29, 2020, 11:24:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wylek

Something is wrong permissions work.

If you set permissions like this,


then users can edit their articles.


And if set like this,


then users can edit all articles!


It is desirable that, with this permission, users could edit only their own articles here.

@rjen

This is the way it should work :  manage articles grants permission to change all articles, edit own articles allows users to only edit their own...

What do you think is wrong?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

wylek

How do I make the article management give permission to edit only its own articles?

@rjen

You don't , it's not meant to do that Manage articles is for ALL.
Running Latest TP on SMF2.1 at: www.fjr-club.nl

wylek

Well why, all this can be done here ;)

function article_options($render = true)
{
global $scripturl, $txt, $context, $settings;

    $data = '';

if(!isset($context['TPortal']['article']['boardnews'])) {
// give 'em a edit link? :)
if(allowedTo('tp_articles') && ($context['TPortal']['hide_editarticle_link']!=1)) {

$data .= '
<a href="' . $scripturl . '?action=tpadmin;sa=editarticle;article=' . $context['TPortal']['article']['id'] . '"><img style="margin: 2px 4px 0 0;float:right" src="' .$settings['tp_images_url']. '/TPedit2.png" alt="" title="'.$txt['tp-edit'].'" /></a>';
        }
// their own article?
elseif(allowedTo('tp_editownarticle') && !allowedTo('tp_articles') && ($context['TPortal']['article']['author_id'] == $context['user']['id']) && $context['TPortal']['hide_editarticle_link']!=1 && $context['TPortal']['article']['locked']!=1) {
$data .= '
<a href="' . $scripturl . '?action=tpadmin;sa=editarticle;article=' . $context['TPortal']['article']['id'] . '"><img style="margin: 2px 4px 0 0;float:right" src="' .$settings['tp_images_url']. '/TPedit2.png" alt="" title="'.$txt['tp-edit'].'" /></a>';
        }
}

@rjen

Of course you can put the icon there, but permissions are also checked in the admin section... it will require more changes, and since this is not how it is supposed to function we cannot support it.
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: wylek on September 29, 2020, 04:30:38 PM
How do I make the article management give permission to edit only its own articles?

What do you mean article management?

As rjen has said, an user can either edit their own articles only, or they can edit all articles.

I don't quite understand what you are looking for?

@rjen

Quote from: tino on September 29, 2020, 08:00:08 PM
Quote from: wylek on September 29, 2020, 04:30:38 PM
How do I make the article management give permission to edit only its own articles?

What do you mean article management?

As rjen has said, an user can either edit their own articles only, or they can edit all articles.

I don't quite understand what you are looking for?

I think he wants to give users full admin access to articles, but only their own articles. Might be nice to give users access to select the category and icons for their articles, but not something TinyPortal is designed to facilitate...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

But then you have to give them access to categories or only certain categories. It becomes quite messy...

If the privileges were rewritten completely this might be doable, it's certainly easier in 2.0.x than it was in 1.6.x

If wylek would like to create a PR with the changes we can review and look to implement it if it doesn't have a negative impact or have security implications.

@rjen

Sure, I am open to contributions. I am just not sure how this would work out... it would also require access permissions on categories and more.

And what about te implications: you give non admins powers to make their articles featured, or sticky, and change all layout options and so on....

Since this is the first time this question comes up I wonder how many admins really require this functionality ?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

This website is proudly hosted on Crocweb Cloud Website Hosting.