public function grantTo(DataObject $node, $perm, $email, $group, $grant = 'GRANT')
    {
        $userObj = $groupObj = null;
        if (strlen($email)) {
            $userObj = DataObject::get_one('Member', '"Email" = \''. Convert::raw2sql($email).'\'');
        } elseif (strlen($group)) {
            $groupObj = DataObject::get_one('Group', '"Title" = \'' . Convert::raw2sql($group).'\'');
        }

        $to = $userObj ? $userObj : $groupObj;
        
        if (!$to) {
            return array('status' => false, 'message' => 'Unknown authority');
        }
        
        return $this->grant($node, $perm, $to, $grant);
    }
public function grantTo(DataObject $node, $perm, $email, $group, $grant = 'GRANT')
    {
        $userObj = $groupObj = null;
        if (strlen($email)) {
            $userObj = DataObject::get_one('Member', '"Email" = \''. Convert::raw2sql($email).'\'');
        } elseif (strlen($group)) {
            $groupObj = DataObject::get_one('Group', '"Title" = \'' . Convert::raw2sql($group).'\'');
        }

        $to = $userObj ? $userObj : $groupObj;
        
        if (!$to) {
            return array('status' => false, 'message' => 'Unknown authority');
        }
        
        return $this->grant($node, $perm, $to, $grant);
    }
public function grantTo ( DataObject $ node , $ perm , $ email , $ group , $ grant = 'GRANT' ) { $ userObj = $ groupObj = null ; if ( strlen ( $ email ) ) { $ userObj = DataObject :: get_one ( 'Member' , '"Email" = \'' . Convert :: raw2sql ( $ email ) . '\'' ) ; } elseif ( strlen ( $ group ) ) { $ groupObj = DataObject :: get_one ( 'Group' , '"Title" = \'' . Convert :: raw2sql ( $ group ) . '\'' ) ; } $ to = $ userObj ? $ userObj : $ groupObj ; if ( ! $ to ) { return array ( 'status' => false , 'message' => 'Unknown authority' ) ; } return $ this -> grant ( $ node , $ perm , $ to , $ grant ) ; }
Alternative grant method using group name or email address

@param DataObject $node
@param type $perm
@param DataObject $to
@param type $grant
Alternative grant method using group name or email address