Create common function for userIsFormOwner & rewrite protected form (#244)
* Create common function for userIsFormOwner & rewrite protected form * fix testcase
This commit is contained in:
@@ -61,6 +61,11 @@ class User extends Authenticatable implements JWTSubject
|
||||
|
||||
protected $withCount = ['workspaces'];
|
||||
|
||||
public function ownsForm(Form $form)
|
||||
{
|
||||
return $this->workspaces()->find($form->workspace_id) !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the profile photo URL attribute.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user