示例#1
0
文件: User.php 项目: Andyyang1981/pi
 /**
  * Get user role
  *
  * @param int    $uid
  * @param string $section   Section name: admin, front
  *
  * @return string|array
  */
 public function getRole($uid, $section = '')
 {
     return parent::getRole($uid, $section);
 }
示例#2
0
 /**
  * {@inheritDoc}
  */
 public function getRole($uid, $section = '')
 {
     $section = $section ?: Pi::engine()->application()->getSection();
     $roles = parent::getRole($uid, $section);
     if ($uid && 'front' == $section) {
         if (!in_array('member', $roles)) {
             $roles[] = 'member';
         }
     }
     return $roles;
 }