mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 19:10:40 +00:00
visitor zipping
This commit is contained in:
@@ -5,14 +5,15 @@ use Domain\Sharing\Models\Share;
|
||||
|
||||
class ProtectShareRecordAction
|
||||
{
|
||||
private string $message = "Sorry, you don't have permission";
|
||||
|
||||
public function __invoke(
|
||||
Share $shared
|
||||
): void {
|
||||
if ($shared->is_protected) {
|
||||
$abort_message = "Sorry, you don't have permission";
|
||||
|
||||
if (! request()->hasCookie('share_session')) {
|
||||
abort(403, $abort_message);
|
||||
abort(403, $this->message);
|
||||
}
|
||||
|
||||
// Get shared session
|
||||
@@ -22,12 +23,12 @@ class ProtectShareRecordAction
|
||||
|
||||
// Check if is requested same share record
|
||||
if ($share_session->token !== $shared->token) {
|
||||
abort(403, $abort_message);
|
||||
abort(403, $this->message);
|
||||
}
|
||||
|
||||
// Check if share record was authenticated previously via ShareController@authenticate
|
||||
if (! $share_session->authenticated) {
|
||||
abort(403, $abort_message);
|
||||
abort(403, $this->message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user