Thu Jan 12 13:41:56 2006

Ticket #1640 (Closed: invalid)

user rights: may change article does not show 'edit' in the view article window


Priority: normal Reporter: micz
Severity: major Assigned to: paul
Component: Admin Interface Status: closed
Version: 2.4.0 Resolution: invalid
Milestone: 2.4.1 Keywords:  

Description by micz:

hit me if i am wrong, but if i create a new user type and ONLY allow to edit articles, then log in and go to the view article window, the link 'edit' does not show up. so i don't know how to edit the article.

Changelog

Fri Jan 13 18:38:03 2006: Modified by paul

  • status changed from new to assigned

Fri Jan 13 18:42:04 2006: Modified by paul

  • resolution set to invalid
  • status changed from assigned to closed

You cant change articles once they are pubished:

	/**
	 * Return true if the given user has permission to modify the content of this article.
	 *
	 * 1) Publishers can always edit.
	 * 2) Users who have the ChangeArticle right can edit as long as the
	 *    article is not published.  i.e. they can edit ALL articles that are 
	 *    new or submitted.
	 * 3) Users with the AddArticle right can edit as long as they created
	 *    the article, and the article is in the "New" state.
	 *
	 * @return boolean
	 */
	function userCanModify($p_user) 
	{
		$userCreatedArticle = ($this->m_data['IdUser'] == $p_user->getUserId());
		$articleIsNew = ($this->m_data['Published'] == 'N');
		$articleIsNotPublished = (($this->m_data['Published'] == 'N') || ($this->m_data['Published'] == 'S'));
		if ($p_user->hasPermission('Publish') 
			|| ($p_user->hasPermission('ChangeArticle') && $articleIsNotPublished)
			|| ($userCreatedArticle && $articleIsNew)) {
			return true;
		} else {
			return false;
		}
	} // fn userCanModify