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

Changeset 12754


Ignore:
Timestamp:
Aug 26, 2009, 1:30:34 PM (11 years ago)
Author:
ebihara
Message:

#3943:added ACL support for the MemberConfig? model

Location:
OpenPNE3/trunk/lib/model/doctrine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/model/doctrine/MemberConfig.class.php

    r11479 r12754  
    99 */
    1010
    11 class MemberConfig extends BaseMemberConfig
     11class MemberConfig extends BaseMemberConfig implements opAccessControlRecordInterface
    1212{
    1313  public function savePre()
     
    7979    return $config[$this->getName()];
    8080  }
     81
     82  public function generateRoleId(Member $member)
     83  {
     84    if ($this->Member->id === $member->id)
     85    {
     86      return 'self';
     87    }
     88
     89    return 'everyone';
     90  }
    8191}
  • OpenPNE3/trunk/lib/model/doctrine/MemberConfigTable.class.php

    r11479 r12754  
    99 */
    1010
    11 class MemberConfigTable extends Doctrine_Table
     11class MemberConfigTable extends opAccessControlDoctrineTable
    1212{
    1313  public $results;
     
    7373  }
    7474
     75  public function appendRoles(Zend_Acl $acl)
     76  {
     77    return $acl
     78      ->addRole(new Zend_Acl_Role('everyone'))
     79      ->addRole(new Zend_Acl_Role('self'), 'everyone');
     80  }
     81
     82  public function appendRules(Zend_Acl $acl, $resource = null)
     83  {
     84    $assertion = new opMemberProfilePublicFlagAssertion();
     85
     86    return $acl
     87      ->allow('self', $resource, 'view')
     88      ->allow('self', $resource, 'edit')
     89      ->deny('everyone');
     90  }
    7591}
  • OpenPNE3/trunk/lib/model/doctrine/MemberProfile.class.php

    r12753 r12754  
    181181      return 'self';
    182182    }
    183     elseif ($relation && $relation->getIsAccessBlock())
     183    elseif ($relation)
    184184    {
    185       return 'blocked';
     185      if ($relation->getIsAccessBlock())
     186      {
     187        return 'blocked';
     188      }
     189      elseif ($relation->getIsFriend())
     190      {
     191        return 'friend';
     192      }
    186193    }
    187194
Note: See TracChangeset for help on using the changeset viewer.