ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 10356


Ignore:
Timestamp:
Jan 25, 2009, 12:06:31 AM (12 years ago)
Author:
ebihara
Message:

#3376:addded some method for managing community privilege

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/model/Community.php

    r10003 r10356  
    5353  }
    5454
     55  public function checkPrivilegeBelong($memberId)
     56  {
     57    if (!$this->isPrivilegeBelong($memberId))
     58    {
     59      throw new opPrivilegeException('fail');
     60    }
     61  }
     62
     63  public function isPrivilegeBelong($memberId)
     64  {
     65    $c = new Criteria();
     66    $c->add(CommunityMemberPeer::MEMBER_ID, $memberId);
     67
     68    return (bool)$this->getCommunityMembers($c);
     69  }
     70
     71  public function isAdmin($memberId)
     72  {
     73    $c = new Criteria();
     74    $c->add(CommunityMemberPeer::MEMBER_ID, $memberId);
     75    $c->add(CommunityMemberPeer::POSITION, 'admin');
     76
     77    return (bool)$this->getCommunityMembers($c);
     78  }
    5579}
Note: See TracChangeset for help on using the changeset viewer.