followers portal access check

This commit is contained in:
Yuri Kuznetsov
2021-03-31 13:11:43 +03:00
parent 78b9bf9823
commit c032541f69
+8 -1
View File
@@ -1975,6 +1975,10 @@ class Record implements Crud,
throw new Forbidden("No 'read' access to user.");
}
if ($user->isPortal() && !$this->getAcl()->get('portal')) {
throw new Forbidden("No 'portal' permission.");
}
$result = $this->getStreamService()->followEntity($entity, $foreignId);
if (!$result) {
@@ -2012,11 +2016,14 @@ class Record implements Crud,
throw new Forbidden("No 'read' access to user.");
}
if ($user->isPortal() && !$this->getAcl()->get('portal')) {
throw new Forbidden("No 'portal' permission.");
}
if (!$this->getUser()->isAdmin()) {
throw new Forbidden();
}
$this->getStreamService()->unfollowEntity($entity, $foreignId);
}