I 'm writing a listView's default layout for my component in which I 'm implementing Joomla's publish & unpublished feature in which user can publish an item on single click on check box. I am little confused about statement of getting user authentication for $canChange given below:
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0;
can any body tell me way we authenticate user against com_checkin.?
secondly I think it is wrong, this should be like following:
$canCheckin = $user->authorise('core.manage', 'com_my_component') && $item->checked_out==$user->id || $item->checked_out==0;
In the above code I authenticate user against my component to make sure if user authorise for check_in, also I check if the the item is not checked to other user for editing
now the question is where is am I wrong and if I am right then why com_content authenticate user against com_checkin