Cancel new item in frontend not possible with core.edit.own

More
10 years 10 months ago #43191 by anonyme
Cancel task is not working in front end view when the user have only the core.edit.own permission.

My version : 2.1.0 r1776

This is due to the following line in the cancel method of the class FlexicontentController ( components\com_flexicontent\controller.php ) :

$canEdit = $user->authorise('core.edit', $asset) || ($user->authorise('core.edit.own', $asset) && $item->created_by == $user->get('id'));

$item is not defined and as such canEdit is still false despite having 'core.edit.own'.

Fixed by using :
$canEdit = $user->authorise('core.edit', $asset) || ($user->authorise('core.edit.own', $asset) && $model->get('created_by') == $user->get('id'));

I have quickly checked the latest version and the bug is still there. ( v2.1.2 1806 for J2.5/J3.x )


Regards and thank you for your countless hours of work mate, great jobs.

Website : in construction

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #43194 by micker
thanks for feeback

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #43225 by ggppdk
Hello

you are right, in the rest of the 'cancel' function code
$model->get(...)
is used instead of $item

committed fix in r1821, thanks for feedback

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.310 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline