function permissionsFor($member) {
        $member = $this->guild->members->resolve($member);
        
        if($member->id === $this->guild->ownerID) {
            return (new \CharlotteDunois\Yasmin\Models\Permissions(\CharlotteDunois\Yasmin\Models\Permissions::ALL));
        }
        
        $permissions = $member->permissions;
        
        if($permissions->has('ADMINISTRATOR')) {
            return (new \CharlotteDunois\Yasmin\Models\Permissions(\CharlotteDunois\Yasmin\Models\Permissions::ALL));
        }
        
        $overwrites = $this->overwritesFor($member);
        
        if($overwrites['everyone']) {
            $permissions->remove(($overwrites['everyone']->deny->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
            $permissions->add(($overwrites['everyone']->allow->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
        }
        
        foreach($overwrites['roles'] as $role) {
            $permissions->remove(($role->deny->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
            $permissions->add(($role->allow->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
        }
        
        if($overwrites['member']) {
            $permissions->remove(($overwrites['member']->deny->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
            $permissions->add(($overwrites['member']->allow->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
        }
        
        return $permissions;
    }
function permissionsFor($member) {
        $member = $this->guild->members->resolve($member);
        
        if($member->id === $this->guild->ownerID) {
            return (new \CharlotteDunois\Yasmin\Models\Permissions(\CharlotteDunois\Yasmin\Models\Permissions::ALL));
        }
        
        $permissions = $member->permissions;
        
        if($permissions->has('ADMINISTRATOR')) {
            return (new \CharlotteDunois\Yasmin\Models\Permissions(\CharlotteDunois\Yasmin\Models\Permissions::ALL));
        }
        
        $overwrites = $this->overwritesFor($member);
        
        if($overwrites['everyone']) {
            $permissions->remove(($overwrites['everyone']->deny->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
            $permissions->add(($overwrites['everyone']->allow->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
        }
        
        foreach($overwrites['roles'] as $role) {
            $permissions->remove(($role->deny->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
            $permissions->add(($role->allow->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
        }
        
        if($overwrites['member']) {
            $permissions->remove(($overwrites['member']->deny->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
            $permissions->add(($overwrites['member']->allow->bitfield & ~\CharlotteDunois\Yasmin\Models\Permissions::CHANNEL_UNACCESSIBLE_PERMISSIONS));
        }
        
        return $permissions;
    }
function permissionsFor ( $ member ) { $ member = $ this -> guild -> members -> resolve ( $ member ) ; if ( $ member -> id === $ this -> guild -> ownerID ) { return ( new \ CharlotteDunois \ Yasmin \ Models \ Permissions ( \ CharlotteDunois \ Yasmin \ Models \ Permissions :: ALL ) ) ; } $ permissions = $ member -> permissions ; if ( $ permissions -> has ( 'ADMINISTRATOR' ) ) { return ( new \ CharlotteDunois \ Yasmin \ Models \ Permissions ( \ CharlotteDunois \ Yasmin \ Models \ Permissions :: ALL ) ) ; } $ overwrites = $ this -> overwritesFor ( $ member ) ; if ( $ overwrites [ 'everyone' ] ) { $ permissions -> remove ( ( $ overwrites [ 'everyone' ] -> deny -> bitfield & ~ \ CharlotteDunois \ Yasmin \ Models \ Permissions :: CHANNEL_UNACCESSIBLE_PERMISSIONS ) ) ; $ permissions -> add ( ( $ overwrites [ 'everyone' ] -> allow -> bitfield & ~ \ CharlotteDunois \ Yasmin \ Models \ Permissions :: CHANNEL_UNACCESSIBLE_PERMISSIONS ) ) ; } foreach ( $ overwrites [ 'roles' ] as $ role ) { $ permissions -> remove ( ( $ role -> deny -> bitfield & ~ \ CharlotteDunois \ Yasmin \ Models \ Permissions :: CHANNEL_UNACCESSIBLE_PERMISSIONS ) ) ; $ permissions -> add ( ( $ role -> allow -> bitfield & ~ \ CharlotteDunois \ Yasmin \ Models \ Permissions :: CHANNEL_UNACCESSIBLE_PERMISSIONS ) ) ; } if ( $ overwrites [ 'member' ] ) { $ permissions -> remove ( ( $ overwrites [ 'member' ] -> deny -> bitfield & ~ \ CharlotteDunois \ Yasmin \ Models \ Permissions :: CHANNEL_UNACCESSIBLE_PERMISSIONS ) ) ; $ permissions -> add ( ( $ overwrites [ 'member' ] -> allow -> bitfield & ~ \ CharlotteDunois \ Yasmin \ Models \ Permissions :: CHANNEL_UNACCESSIBLE_PERMISSIONS ) ) ; } return $ permissions ; }
Returns the permissions for the given member.
@param \CharlotteDunois\Yasmin\Models\GuildMember|string  $member
@return \CharlotteDunois\Yasmin\Models\Permissions
@throws \InvalidArgumentException
@see https://discordapp.com/developers/docs/topics/permissions#permission-overwrites
Returns the permissions for the given member .