Merge pull request 'changed logic in shared editor page' (#1514) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #1514
This commit was merged in pull request #1514.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Models\Configuration;
|
||||
use App\Models\SharedClipBoard;
|
||||
use Filament\Pages\Page;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -69,7 +70,24 @@ class SharedEditor extends Page
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return Auth::check() && Auth::user()->can('view shared clipboard page');
|
||||
// return Auth::check() && Auth::user()->can('view shared clipboard page');
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
if(Auth::check() && !Auth::user()->can('view shared clipboard page'))
|
||||
{
|
||||
if (!$user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$configuration = Configuration::where('c_group', 'Shared Clip Board')->where('c_value', $user->name)->first();
|
||||
|
||||
return $configuration ? true:false;
|
||||
|
||||
}
|
||||
else{
|
||||
return Auth::check() && Auth::user()->can('view shared clipboard page');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user