Improve Templates (#183)
* Improve Templates * Fix test case * Update AI GenerateTemplate * update openai client and GPT completer * composer.lock * Update types and list json with script * Template changes * fix on draft template * Finish opnform templates --------- Co-authored-by: Forms Dev <chirag+new@notionforms.io> Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -18,6 +18,30 @@ class TemplatePolicy
|
||||
*/
|
||||
public function create(User $user)
|
||||
{
|
||||
return $user->template_editor;
|
||||
return $user->admin || $user->template_editor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Template $template
|
||||
* @return mixed
|
||||
*/
|
||||
public function update(User $user, Template $template)
|
||||
{
|
||||
return $user->admin || $user->template_editor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Template $template
|
||||
* @return mixed
|
||||
*/
|
||||
public function delete(User $user, Template $template)
|
||||
{
|
||||
return $user->admin || $user->template_editor;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user