Document permissions

This commit is contained in:
David Bomba 2020-08-12 13:13:39 +10:00
parent de24d00315
commit e347c5ad51
9 changed files with 29 additions and 8 deletions

View File

@ -49,7 +49,7 @@ class DocumentController extends Controller
{
$contact = auth()->user();
Storage::makeDirectory('public/' . $contact->client->client_hash, 0755);
Storage::makeDirectory('public/' . $contact->client->client_hash, 0775);
$path = Storage::putFile('public/' . $contact->client->client_hash, $request->file('file'));

View File

@ -87,7 +87,7 @@ class CreateCreditPdf implements ShouldQueue
$html = (new HtmlEngine($designer, $this->invitation, 'credit'))->build();
Storage::makeDirectory($path, 0755);
Storage::makeDirectory($path, 0775);
$pdf = $this->makePdf(null, null, $html);

View File

@ -86,7 +86,7 @@ class CreateInvoicePdf implements ShouldQueue
$html = (new HtmlEngine($designer, $this->invitation, 'invoice'))->build();
//todo - move this to the client creation stage so we don't keep hitting this unnecessarily
Storage::makeDirectory($path, 0755);
Storage::makeDirectory($path, 0775);
$pdf = $this->makePdf(null, null, $html);

View File

@ -84,7 +84,7 @@ class CreateQuotePdf implements ShouldQueue
$designer = new Designer($this->quote, $design, $this->quote->client->getSetting('pdf_variables'), 'quote');
//todo - move this to the client creation stage so we don't keep hitting this unnecessarily
Storage::makeDirectory($path, 0755);
Storage::makeDirectory($path, 0775);
$html = (new HtmlEngine($designer, $this->invitation, 'quote'))->build();

View File

@ -39,7 +39,7 @@ class UploadAvatar implements ShouldQueue
{
//make dir
Storage::makeDirectory('public/' . $this->directory, 0755);
Storage::makeDirectory('public/' . $this->directory, 0775);
$tmp_file = sha1(time()).".png";

View File

@ -76,7 +76,7 @@ class Activity extends StaticModel
const PAID_INVOICE=54; //
const EMAIL_INVOICE_FAILED=57;
const REVERSED_INVOICE=58; //
const CANCELLED_INVOICE=59;
const CANCELLED_INVOICE=59; //
const VIEW_CREDIT=60; //
protected $casts = [

View File

@ -63,7 +63,7 @@ class Phantom
$phantom_url = "https://phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$url}%22,renderType:%22pdf%22%7D";
$pdf = \App\Utils\CurlUtils::get($phantom_url);
Storage::makeDirectory($path, 0755);
Storage::makeDirectory($path, 0775);
$instance = Storage::disk(config('filesystems.default'))->put($file_path, $pdf);

View File

@ -46,6 +46,16 @@ return [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'permissions' => [
'file' => [
'public' => 0664,
'private' => 0600,
],
'dir' => [
'public' => 0777,
'private' => 0700,
],
],
],
'public' => [
@ -53,6 +63,16 @@ return [
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'permissions' => [
'file' => [
'public' => 0664,
'private' => 0600,
],
'dir' => [
'public' => 0777,
'private' => 0700,
],
],
],
's3' => [

View File

@ -65,7 +65,8 @@ class DesignTest extends TestCase
$this->invoice->uses_inclusive_taxes = false;
$this->invoice->service()->createInvitations()->markSent()->save();
$this->invoice->service()->createInvitations()->markSent()->applyNumber()->save();
$this->invoice->fresh();
$this->invoice->load('invitations');