Exemplo n.º 1
0
 /**
  * Method to test whether a record can be deleted.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission for the component.
  *
  * @since   1.6
  */
 protected function canEditState($record)
 {
     if (!empty($record->catid)) {
         return JFactory::getUser()->authorise('core.edit.state', 'com_htraininglogs.category.' . (int) $record->catid);
     }
     return parent::canEditState($record);
 }
Exemplo n.º 2
0
 /**
  * Method to test whether a record can be deleted.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission for the component.
  *
  * @since   1.0.0
  */
 protected function canEditState($record)
 {
     if (!empty($record->catid)) {
         return JFactory::getUser()->authorise('core.edit.state', 'com_digicom.discount.' . (int) $record->catid);
     }
     return parent::canEditState($record);
 }
Exemplo n.º 3
0
 /**
  * Method to test whether a record can have its state edited.
  *
  * @param	object	A record object.
  *
  * @return	boolean	True if allowed to change the state of the record. Defaults to the permission set in the component.
  * @since	1.6
  */
 protected function canEditState($record)
 {
     if (!empty($record->id)) {
         return User::authorise('core.edit.state', 'com_menus.item.' . (int) $record->id);
     } else {
         return parent::canEditState($record);
     }
 }
Exemplo n.º 4
0
 /**
  * Method to test whether a record can have its state edited.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission set in the component.
  *
  * @since   1.6
  */
 protected function canEditState($record)
 {
     $permissions = SibdietHelper::getUserPermissions();
     if (in_array('contags', $permissions)) {
         return parent::canEditState($record);
     }
     return false;
 }
Exemplo n.º 5
0
 /**
  * Method to test whether a record can have its state edited.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission set in the component.
  *
  * @since   1.6
  */
 protected function canEditState($record)
 {
     $permissions = SibdietHelper::getUserPermissions();
     // Check requests manage permission first.
     if (in_array('setdiets', $permissions)) {
         return parent::canEditState($record);
     }
     return false;
 }
Exemplo n.º 6
0
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     if ($record->imgid) {
         return $user->authorise('core.edit.state', 'com_phocagallery.phocagallerycoimg.' . (int) $record->imgid);
     } else {
         return parent::canEditState($record);
     }
 }
Exemplo n.º 7
0
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     if (!empty($record->id)) {
         return $user->authorise('core.edit.state', 'com_bt_socialconnect.widget.' . (int) $record->id);
     } else {
         return parent::canEditState('com_bt_socialconnect');
     }
 }
Exemplo n.º 8
0
 /**
  * Method to test whether a record can be deleted.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission for the component.
  *
  * @since   1.6
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     if (!empty($record->id)) {
         return $user->authorise('core.edit.state', 'com_azurapagebuilder.page.' . (int) $record->id);
     } else {
         return parent::canEditState($record);
     }
 }
Exemplo n.º 9
0
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     /*if (!empty($record->catid)) {
     			return $user->authorise('core.edit.state', 'com_phocagallery.phocagalleryuser');
     		} else {*/
     return parent::canEditState($record);
     //}
 }
Exemplo n.º 10
0
 /**
  * Method to test whether a record can have its state changed.
  *
  * @param	object	A record object.
  * @return	boolean	True if allowed to change the state of the record. Defaults to the permission set in the component.
  * @since	1.6
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     if (!empty($record->catid)) {
         return $user->authorise('core.edit.state', 'com_faqs.category.' . (int) $record->catid);
     } else {
         return parent::canEditState($record);
     }
 }
Exemplo n.º 11
0
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     // Check for existing article.
     if (!empty($record->id)) {
         return $user->authorise('core.edit.state', 'com_bt_socialconnect.message.' . (int) $record->id);
     } else {
         return parent::canEditState('com_bt_socialconnect');
     }
 }
Exemplo n.º 12
0
 /**
  * Method to test whether a record can have its state changed.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission set in the component.
  *
  * @since   1.6
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     // Check against the category.
     if (!empty($record->catid)) {
         return $user->authorise('core.edit.state', 'com_jnt_hanhphuc.category.' . (int) $record->catid);
     } else {
         return parent::canEditState($record);
     }
 }
Exemplo n.º 13
0
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     if (!empty($record->id)) {
         return $user->authorise('core.edit.state', 'com_judirectory.field.' . $record->id);
     } elseif (!empty($record->group_id)) {
         return $user->authorise('core.edit.state', 'com_judirectory.fieldgroup.' . (int) $record->group_id);
     } else {
         return parent::canEditState($record);
     }
 }
Exemplo n.º 14
0
 /**
  * Method to test whether a record can be deleted.
  *
  * @param JForm $record a record object.
  * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
  */
 protected function canEditState($record)
 {
     if (!empty($record)) {
         if ($record instanceof JForm) {
             return JoomDOCAccessDocument::editState($record->getValue('id'), $record->getValue('checked_out'), $record->getValue('path'));
         } else {
             return JoomDOCAccessDocument::editState($record->id, $record->checked_out, $record->path);
         }
     }
     return parent::canEditState($record);
 }
Exemplo n.º 15
0
 /**
  * Method to test whether a record state can be changed.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission for the component.
  *
  * @since   11.1
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     $fid = JFactory::getApplication()->input->getInt('fid', -1);
     // Check form settings.
     if ($fid != -1) {
         return $user->authorise('core.edit.state', 'com_visforms.visform.' . (int) $fid);
     } else {
         return parent::canEditState($record);
     }
 }
Exemplo n.º 16
0
 /**
  * Method to test whether a record can be deleted.
  *
  * @param	object	$record	A record object.
  *
  * @return	boolean	True if allowed to change the state of the record. Defaults to the permission set in the component.
  * @since	1.6
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     // Check for existing article.
     if (!empty($record->id)) {
         return $user->authorise('core.edit.state', 'com_content.article.' . (int) $record->id);
     } else {
         if (!empty($record->catid)) {
             return $user->authorise('core.edit.state', 'com_content.category.' . (int) $record->catid);
         } else {
             return parent::canEditState($record);
         }
     }
 }
Exemplo n.º 17
0
 /**
  * Method to test whether a record can have its state changed.
  *
  * @param
  *        	object A record object.
  * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
  * @since 1.6
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     if (!empty($record->catid)) {
         $canEditState = $user->authorise('core.edit.state', 'com_edashboard.category.' . (int) $record->catid);
     } else {
         $canEditState = parent::canEditState($record);
     }
     // ABP: Additional check on pub dates: deny if published, only superadmin can change
     if ($canEditState && !$user->authorise('core.admin') && $record->id) {
         $item = $this->getItem($record->id);
         $canEditState = !$this->isPublished($item);
     }
     return $canEditState;
 }
Exemplo n.º 18
0
 /**
  * Method to test whether a record can have its state edited.
  * Defaults to the permission set in the component.
  *
  * @param     object     A record object.
  *
  * @return    boolean    True if allowed to delete the record.
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     // Check for existing item.
     if (!empty($record->id)) {
         return $user->authorise('core.edit.state', 'com_pfrepo.directory.' . (int) $record->id);
     } elseif (!empty($record->parent_id)) {
         // New item, so check against the parent dir.
         return $user->authorise('core.edit.state', 'com_pfrepo.directory.' . (int) $record->parent_id);
     } else {
         // Default to component settings.
         return parent::canEditState('com_pfrepo');
     }
 }
Exemplo n.º 19
0
	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object    $record    A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record. Defaults to the permission set in the component.
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();

		// Check for existing article.
		if (!empty($record->id))
		{
			return $user->authorise('core.edit.state', 'com_content.article.' . (int) $record->id);
		}
		// New article, so check against the category.
		elseif (!empty($record->catid))
		{
			return $user->authorise('core.edit.state', 'com_content.category.' . (int) $record->catid);
		}
		// Default to component settings if neither article nor category known.
		else
		{
			return parent::canEditState('com_content');
		}
	}
Exemplo n.º 20
0
 /**
  * Method to test whether a record can have its state edited.
  * Defaults to the permission set in the component.
  *
  * @param     object     A record object.
  *
  * @return    boolean    True if allowed to delete the record.
  */
 protected function canEditState($record)
 {
     if (empty($record->id)) {
         return parent::canEditState($record);
     }
     $user = JFactory::getUser();
     if (!$user->authorise('core.admin') && !in_array($record->access, $user->getAuthorisedViewLevels())) {
         return false;
     }
     return $user->authorise('core.edit.state', 'com_pftasks.tasklist.' . (int) $record->id);
 }
Exemplo n.º 21
0
 /**
  * Method to test whether a record can have its state edited.
  * Defaults to the permission set in the component.
  *
  * @param     object     A record object.
  *
  * @return    boolean    True if allowed to delete the record.
  */
 protected function canEditState($record)
 {
     if (!empty($record->id)) {
         $user = JFactory::getUser();
         $asset = 'com_pfcomments.comment.' . (int) $record->id;
         return $user->authorise('core.edit', $asset) || $user->authorise('core.edit.own', $asset) && $record->created_by == $user->id;
     }
     return parent::canEditState($record);
 }
Exemplo n.º 22
0
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     $rootCategory = JUDownloadFrontHelperCategory::getRootCategory();
     if ($record->id && $record->id == $rootCategory->id) {
         return false;
     }
     if (!empty($record->id)) {
         return $user->authorise('judl.category.edit.state', 'com_judownload.category.' . (int) $record->id);
     } elseif (!empty($record->parent_id)) {
         return $user->authorise('judl.category.edit.state', 'com_judownload.category.' . (int) $record->parent_id);
     } else {
         return parent::canEditState($record);
     }
 }
Exemplo n.º 23
0
 protected function canEditState($record)
 {
     return parent::canEditState($record);
 }
Exemplo n.º 24
0
 protected function canEditState($record)
 {
     //$user = JFactory::getUser();
     return parent::canEditState($record);
 }
Exemplo n.º 25
0
 /**
  * Method to test whether a record can have its state edited.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission set in the component.
  *
  * @since   1.6
  */
 protected function canEditState($record)
 {
     // Check against the category.
     if (!empty($record->catid)) {
         return JFactory::getUser()->authorise('core.edit.state', 'com_contact.category.' . (int) $record->catid);
     }
     // Default to component settings if category not known.
     return parent::canEditState($record);
 }
Exemplo n.º 26
0
 protected function canEditState($record)
 {
     $rootComment = JUDownloadFrontHelperComment::getRootComment();
     if (isset($record->id) && $record->id == $rootComment->id) {
         return false;
     }
     $app = JFactory::getApplication();
     if ($app->isSite()) {
         $modCanEditState = JUDownloadFrontHelperModerator::checkModeratorCanDoWithComment($record->id, 'comment_edit_state');
         if ($modCanEditState) {
             return true;
         }
         return false;
     }
     return parent::canEditState($record);
 }
 /**
  * Method to test whether a record can have its state edited.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission set in the component.
  *
  * @since   1.6
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     $recordId = !empty($record->id) ? $record->id : 0;
     if ($recordId) {
         // The record has been set. Check the record permissions.
         $permission = $user->authorise('core.edit.state', 'com_componentbuilder.custom_admin_view.' . (int) $recordId);
         if (!$permission && !is_null($permission)) {
             return false;
         }
     }
     // In the absense of better information, revert to the component permissions.
     return parent::canEditState($record);
 }
Exemplo n.º 28
0
 /**
  * Method to test whether a record can have its state edited.
  *
  * @param   object  $record  A record object.
  *
  * @return  boolean  True if allowed to change the state of the record. Defaults to the permission set in the component.
  *
  * @since   3.2
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     // Check for existing module.
     if (!empty($record->id)) {
         return $user->authorise('core.edit.state', 'com_modules.module.' . (int) $record->id);
     } else {
         return parent::canEditState('com_modules');
     }
 }
Exemplo n.º 29
0
 /**
  * Method to test whether a record can have its state changed.
  *
  * @param	object	A record object.
  * @return	boolean	True if allowed to change the state of the record. Defaults to the permission set in the component.
  */
 protected function canEditState($record)
 {
     $user = JFactory::getUser();
     // Check against the id.
     if (!empty($record->id)) {
         return $user->authorise('core.edit.state', 'com_knvbapi2.teamnaam.' . (int) $record->id);
     } else {
         // New teamnaam, so check against the category.
         if (!empty($record->catid)) {
             return $user->authorise('core.edit.state', 'com_knvbapi2.category.' . (int) $record->catid);
         } else {
             // Default to component settings.
             return parent::canEditState($record);
         }
     }
 }
Exemplo n.º 30
0
 /**
  * Method to test whether a record can have its state edited.
  * Defaults to the permission set in the component.
  *
  * @param     object     A record object.
  *
  * @return    boolean    True if allowed to edit the state of the record.
  */
 protected function canEditState($record)
 {
     if (!empty($record->id)) {
         $user = JFactory::getUser();
         $asset = 'com_pfdesigns.album.' . (int) $record->id;
         return $user->authorise('core.edit.state', $asset);
     }
     return parent::canEditState($record);
 }