mgd_is_article_owner

Name

mgd_is_article_owner -- Check article ownership

Synopsis

int mgd_is_article_owner(int article);

Description

Minimum version: Midgard 1.1.1 (Iron River)

Check whether the authenticated user is an owner of the article with id article.

Returns true if the user is an owner of the given article i.e. either its author or a member of a group that owns one of its parent nodes. If the article is locked, its owners are the locker and the administrators only. Returns false if the user is not an owner.

Example

<?php
  $article = 17;
  echo "article $article is ";
  if ( ! mgd_is_article_owner($article) )
  { 
    echo "not ";
  }
  echo "owned by you";
?>