Exemplo n.º 1
0
 public function getPermission($perm)
 {
     $gps = $this->mapped['group']->getMapped('permissionset');
     $ups = $this->mapped['permissionset'];
     $psfields = PermissionSetBean::getFields();
     if (!in_array($perm, $psfields)) {
         return false;
     }
     $status = $gps->{$perm} == 1;
     if (!isset($ups->{$perm}) || is_null($ups->{$perm})) {
         return $status;
     }
     return $ups->{$perm} == 1;
 }
Exemplo n.º 2
0
 public static function getPermission($perm)
 {
     $fields = PermissionSetBean::getFields();
     $pval = NULL;
     if (!in_array($perm, $fields)) {
         return false;
     }
     if (static::$userBean) {
         $pval = static::$userBean->getPermission($perm);
     } else {
         if (static::$pubps) {
             return static::$pubps->{$perm} == 1;
         }
     }
     if (!is_null($pval)) {
         if (static::$ipps) {
             return is_null(static::$ipps->{$perm}) ? $pval : static::$ipps->{$perm};
         } else {
             return $pval;
         }
     }
     return false;
 }