Added template editor separate role

This commit is contained in:
JhumanJ
2022-11-16 13:12:48 +01:00
parent d8bf96501b
commit 88812776db
7 changed files with 37 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ class TemplateController extends Controller
public function create(CreateTemplateRequest $request)
{
$this->middleware('admin');
$this->authorize('create', Template::class);
// Create template
$template = $request->getTemplate();
@@ -28,5 +28,4 @@ class TemplateController extends Controller
'template_id' => $template->id
]);
}
}

View File

@@ -18,6 +18,7 @@ class UserResource extends JsonResource
'is_subscribed' => $this->is_subscribed,
'has_enterprise_subscription' => $this->has_enterprise_subscription,
'admin' => $this->admin,
'template_editor' => $this->template_editor,
'has_customer_id' => $this->has_customer_id,
'has_forms' => $this->has_forms,
] : [];