? Pending

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
8 Aug 2016

Pull Request for Issue #11463 and #11510

Summary of Changes

Fixed edit check in backend not allowing edit via edit.own after soft deny
Same code used for frontend

Testing Instructions

(check is the same for frontend / backend)

at backend articles manager,
at frontend views that show the edit button

make sure that people that should be allowed to edit can do and others can not

avatar joomla-cms-bot joomla-cms-bot - change - 8 Aug 2016
Category Administration Components Front End
avatar ggppdk ggppdk - open - 8 Aug 2016
avatar ggppdk ggppdk - change - 8 Aug 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Aug 2016
Labels Added: ?
avatar ggppdk ggppdk - change - 8 Aug 2016
Title
Fix edit check in backend not allowing edit via edit.own after soft deny
Fix edit check in backend articles manager, always denying edit after soft deny
avatar ggppdk ggppdk - edited - 8 Aug 2016
avatar ggppdk ggppdk - change - 8 Aug 2016
The description was changed
avatar ggppdk ggppdk - edited - 8 Aug 2016
avatar infograf768 infograf768 - test_item - 8 Aug 2016 - Tested successfully
avatar infograf768
infograf768 - comment - 8 Aug 2016

I have tested this item successfully on

Looks like working here.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11511.

avatar alikon
alikon - comment - 8 Aug 2016

i have experienced this issue on GsoC 2016 Multilingual project.

test conditions

  • Create a user "test" added to "Administrator" group

  • Go to com_content Options, Permissions tab and disable "Edit" for "Administrator" group
    permission

  • Create a new content item with the "test" user

before patch
You can't edit your own.

Apply patch
you can edit your own items.

p.s
tested on backend only

avatar infograf768 infograf768 - change - 8 Aug 2016
Title
Fix edit check in backend articles manager, always denying edit after soft deny
Regression: Fix edit check in backend articles manager, always denying edit after soft deny
avatar joomla-cms-bot joomla-cms-bot - edited - 8 Aug 2016
avatar ggppdk ggppdk - change - 8 Aug 2016
The description was changed
avatar ggppdk ggppdk - edited - 8 Aug 2016
avatar jeckodevelopment jeckodevelopment - test_item - 8 Aug 2016 - Tested successfully
avatar jeckodevelopment
jeckodevelopment - comment - 8 Aug 2016

I have tested this item successfully on


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11511.

avatar ggeorgg
ggeorgg - comment - 8 Aug 2016

I have tested this item successfully on
Thanks a lot!

avatar zero-24 zero-24 - alter_testresult - 8 Aug 2016 - ggeorgg: Tested successfully
avatar zero-24 zero-24 - alter_testresult - 8 Aug 2016 - infograf768: Tested successfully
avatar zero-24 zero-24 - alter_testresult - 8 Aug 2016 - jeckodevelopment: Tested successfully
avatar zero-24 zero-24 - change - 8 Aug 2016
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 8 Aug 2016

RTC. Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11511.

avatar joomla-cms-bot joomla-cms-bot - change - 8 Aug 2016
Labels Added: ?
avatar matrix630307
matrix630307 - comment - 9 Aug 2016

I have tested this item successfully. Thank's.

avatar zero-24 zero-24 - change - 10 Aug 2016
Status Ready to Commit Pending
avatar zero-24
zero-24 - comment - 10 Aug 2016

Put off RTC so we get a retest after the last changes Thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11511.

avatar joomla-cms-bot joomla-cms-bot - change - 10 Aug 2016
Labels Removed: ?
avatar ggppdk
ggppdk - comment - 10 Aug 2016

yes i made 1 more change (besides comments),

  • always return false if article id is 0

I searched through all calls of the method, i did not find any usage that will need to return component permissions, in such a case,

so better return false (aka deny), in case someone in the future writes code to misuse this

avatar mbabker
mbabker - comment - 10 Aug 2016

Except this is wrong. You've introduced a hard deny rule instead of continued use of the ACL system in this scenario. So there needs to be a pretty freakin' strong validation against this change because right now that screams massive B/C break to me.

avatar ggppdk
ggppdk - comment - 10 Aug 2016

Can you find a place that is needed today ?
And something that gets broken ?

example

    protected function allowSave($data, $key = 'id')
    {
        $recordId = isset($data[$key]) ? $data[$key] : '0';

        if ($recordId)
        {
            return $this->allowEdit($data, $key);
        }
        else
        {
            return $this->allowAdd($data);
        }
    }

so calling allowEdit() on zero record id as an indirect way to get return parent controler permissions ?
which return the component permission,

is weird usage

i will revert, i made this change worrying of someone misusing it in the future
it creates no problems

avatar mbabker
mbabker - comment - 10 Aug 2016

I don't have a place off hand that will break with that hardcoded change but the point of it is that something that should be reading the ACL system should be doing that, not introducing an arbitrary rule based on some condition and not even implement it consistently.

avatar ggppdk
ggppdk - comment - 10 Aug 2016

I restored the code it is same as before, when all testing was done

but that deny would break nothing anyway, because it is not used anywhere

anyway this is PR makes the allowEdit how it should have been in the first place

avatar mbabker
mbabker - comment - 10 Aug 2016

I agree it shouldn't be getting used, but in the off case someone's code is screwed up somewhere it should still respect the ACL system or throw an Exception because at that point it's dealing with an invalid record anyway.

avatar ggppdk
ggppdk - comment - 10 Aug 2016

The code is correct to be there
i am not saying something different

but after 1 or 2 years someone may write code to misuse it

  • that was my only reason for making that change
avatar mbabker
mbabker - comment - 10 Aug 2016

It needs to be a separate proposal if you're going to push for it. We all have a very bad habit of throwing unrelated items into pull requests because we're already making a change or want to enforce some arbitrary standard. That crap needs to stop.

avatar ggppdk
ggppdk - comment - 10 Aug 2016

It needs to be a separate proposal if you're going to push for it. We all have a very bad habit of throwing unrelated items into pull requests because we're already making a change or want to enforce some arbitrary standard. That crap needs to stop.

yes correct, it is unrelated to this PR, but you know how it is with finding people to test PRs etc

avatar mbabker
mbabker - comment - 10 Aug 2016

Oh I know, I know. I've got cache PRs stalled out because someone asked for an arbitrary extra change, one of which actually adds support for a PHP 5.3 feature to our callback system.

avatar infograf768
infograf768 - comment - 10 Aug 2016

where do we stand here?

avatar ggppdk
ggppdk - comment - 10 Aug 2016

Hello

please click on each of the commit made August 10,
https://github.com/joomla/joomla-cms/pull/11511/commits

5 commits

  • 1 commit changes comments
  • 2 next commits changed in the 2 controllers (frontend / backend identical), for the case of record ID zero
        if (!$recordId)
        {
-           return parent::allowEdit($data, $key);
+           return false;
        }

this should be still be RTC

  • 2 more commits changed it back to be the same as when all tests where made
        if (!$recordId)
        {
-           return false;
+           return parent::allowEdit($data, $key);
        }
avatar zero-24 zero-24 - change - 10 Aug 2016
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 10 Aug 2016

Back to RTC. Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11511.

avatar joomla-cms-bot joomla-cms-bot - change - 10 Aug 2016
Labels Added: ?
avatar Sieger66 Sieger66 - test_item - 14 Aug 2016 - Tested successfully
avatar Sieger66 Sieger66 - test_item - 14 Aug 2016 - Tested successfully
avatar Sieger66
Sieger66 - comment - 14 Aug 2016

I have tested this item successfully on 84d0dad


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11511.

avatar rdeutz rdeutz - change - 14 Aug 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-08-14 16:31:17
Closed_By rdeutz
avatar rdeutz rdeutz - close - 14 Aug 2016
avatar rdeutz rdeutz - merge - 14 Aug 2016
avatar joomla-cms-bot joomla-cms-bot - close - 14 Aug 2016
avatar joomla-cms-bot joomla-cms-bot - change - 14 Aug 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment