-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images are public in private page in private space #308
Comments
@luke- Yes, we have this issue because the checking is executed here https://github.com/humhub/humhub/blob/master/protected/humhub/modules/file/models/File.php#L291-L299: public function canRead($userId = "")
{
$object = $this->getPolymorphicRelation();
if ($object instanceof ContentActiveRecord || $object instanceof ContentAddonActiveRecord) {
return $object->content->canView($userId);
}
return true;
} Image from custom template page is linked to We could extend the core method if ($object instanceof ActiveRecord && method_exists($object, 'canView')) {
return $object->canView();
} and then implement the method Maybe instead of the checking |
@yurabakhtin With |
@luke- Core PR humhub/humhub#6668 - main change there is the method if ($object instanceof ViewableInterface) {
return $object->canView($user);
} I see you already merged the PR, as you can see I have done there a small cleanup in the interfaces. |
Could not agree more. See |
Sounds good. Can you please create a PR to align this? |
|
In a private space:
Add an image in a post.
This image is private (get image url, delete cache, if you enter the url in your browser you will get an error message). It works!
Now add a private custom page in this space.
This custom page is "template" type. It embeds an image container (multiple images)
These images are public. Disapointing !?
Is it the normal behaviour? Did I miss some setting?
The text was updated successfully, but these errors were encountered: