mirror of
https://github.com/humhub/humhub.git
synced 2025-01-29 04:17:39 +01:00
Enh: Added optional ActiveRecordContent::canEdit() method for custom ACLs
This commit is contained in:
parent
1b3d389ace
commit
6aff307f3f
@ -21,6 +21,7 @@ HumHub Change Log
|
||||
- Enh: Added User module 'displayNameCallback' attribute for custom display name formats
|
||||
- Enh: Added Clipboard.js and Permalink "Copy to clipboard" link
|
||||
- Enh: Validate minimum PHP version in Console Application
|
||||
- Enh: Added optional ActiveRecordContent::canEdit() method for custom ACLs
|
||||
|
||||
1.2.0-beta.2 (February 24, 2017)
|
||||
--------------------------------
|
||||
|
@ -179,7 +179,7 @@ class Content extends ContentDeprecated
|
||||
|
||||
\humhub\modules\content\activities\ContentCreated::instance()
|
||||
->about($contentSource)->save();
|
||||
|
||||
|
||||
|
||||
Yii::$app->live->send(new \humhub\modules\content\live\NewContent([
|
||||
'sguid' => ($this->container instanceof Space) ? $this->container->guid : null,
|
||||
@ -432,7 +432,7 @@ class Content extends ContentDeprecated
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->getContainer()->permissionManager->can(new ManageContent())) {
|
||||
if ($this->getContainer() !== null && $this->getContainer()->permissionManager->can(new ManageContent())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -441,6 +441,12 @@ class Content extends ContentDeprecated
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if underlying content implements own canEdit method
|
||||
// ToDo: Implement this as interface
|
||||
if (method_exists($this->getPolymorphicRelation(), 'canEdit') && $this->getPolymorphicRelation()->canEdit($user)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ class DownloadFileHandler extends BaseFileHandler
|
||||
'target' => '_blank',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public static function getUrl($file, $download = 0)
|
||||
{
|
||||
return Url::to(['/file/file/download', 'guid' => $file->guid, 'download' => $download]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user