mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Implement permissions for WOPI
This commit is contained in:
parent
fb743b522d
commit
8c92d11722
@ -65,7 +65,11 @@ class AuthorizationManager implements \ChampsLibres\WopiBundle\Contracts\Authori
|
||||
|
||||
public function userCanRead(string $accessToken, Document $document, RequestInterface $request): bool
|
||||
{
|
||||
return $this->isTokenValid($accessToken, $document, $request);
|
||||
if ($this->security->isGranted('SEE', $document)) {
|
||||
return $this->isTokenValid($accessToken, $document, $request);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function userCanRename(string $accessToken, Document $document, RequestInterface $request): bool
|
||||
@ -75,6 +79,11 @@ class AuthorizationManager implements \ChampsLibres\WopiBundle\Contracts\Authori
|
||||
|
||||
public function userCanWrite(string $accessToken, Document $document, RequestInterface $request): bool
|
||||
{
|
||||
return $this->isTokenValid($accessToken, $document, $request);
|
||||
if ($this->security->isGranted('EDIT', $document)) {
|
||||
return $this->isTokenValid($accessToken, $document, $request);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user