src/Reflex/Lockdown/Roles/Eloquent/Role.php
public function give(PermissionInterface $permission, $level = 'allow')
    {
        $current    =   $this->getPermission($permission->key);
        if (isset($current)) {
            if ($current->level === $level) {
                return true;
            }
            $this->remove($permission);
        }
        $this->cache($permission->key, null);
        $this->permissions()
            ->attach($permission, compact('level'));

        return ! is_null($this->getPermission($permission));
    }
public function give(PermissionInterface $permission, $level = 'allow')
    {
        $current    =   $this->getPermission($permission->key);
        if (isset($current)) {
            if ($current->level === $level) {
                return true;
            }
            $this->remove($permission);
        }
        $this->cache($permission->key, null);
        $this->permissions()
            ->attach($permission, compact('level'));

        return ! is_null($this->getPermission($permission));
    }
public function give ( PermissionInterface $ permission , $ level = 'allow' ) { $ current = $ this -> getPermission ( $ permission -> key ) ; if ( isset ( $ current ) ) { if ( $ current -> level === $ level ) { return true ; } $ this -> remove ( $ permission ) ; } $ this -> cache ( $ permission -> key , null ) ; $ this -> permissions ( ) -> attach ( $ permission , compact ( 'level' ) ) ; return ! is_null ( $ this -> getPermission ( $ permission ) ) ; }
Give role a permission
@param  \Reflex\Lockdown\Permissions\PermissionInterface $permission
Permission instance
@param  string                                           $level
Level
@return boolean
Give role a permission