mirror of
https://github.com/humhub/humhub.git
synced 2025-01-18 06:38:14 +01:00
Removed deprecated methods
This commit is contained in:
parent
a77a2a455a
commit
03fdf0267e
@ -58,3 +58,5 @@ HumHub Change Log (DEVELOP)
|
||||
- Enh: More generic approach to determine themed view files
|
||||
- Enh: Always use ISO 639-1 alpha-2 (and ISO 3166-2) language codes
|
||||
- Enh: Update Yii version to 2.0.27
|
||||
- Enh: Reorganized translation method categories to reduce language files
|
||||
- Enh: Removed deprecated methods/classes since v1.1 - see migration guide for details
|
||||
|
@ -56,7 +56,7 @@ If you're using any custom modules, please change the message directories accord
|
||||
|
||||
The following deprecated method have been removed.
|
||||
|
||||
**Content model**
|
||||
**Content model -removed methods **
|
||||
|
||||
- canWrite()
|
||||
- canRead()
|
||||
@ -64,7 +64,18 @@ The following deprecated method have been removed.
|
||||
- getSpace()
|
||||
- getUser()
|
||||
|
||||
**Removed class**
|
||||
|
||||
- humhub\modules\space\modules\manage\widgets\Menu
|
||||
|
||||
**Space class - removed methods**
|
||||
|
||||
- canInvite()
|
||||
- canShare()
|
||||
|
||||
**Notification class - removed methods**
|
||||
|
||||
- getSpace()
|
||||
|
||||
Migrate from 1.2 to 1.3
|
||||
-----------------------
|
||||
|
@ -160,17 +160,6 @@ class Notification extends \humhub\components\ActiveRecord
|
||||
return $this->hasOne(User::class, ['id' => 'originator_user_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns space of this notification
|
||||
*
|
||||
* @return \yii\db\ActiveQuery
|
||||
* @deprecated since version 1.1
|
||||
*/
|
||||
public function getSpace()
|
||||
{
|
||||
return $this->hasOne(Space::class, ['id' => 'space_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns polymorphic relation linked with this notification
|
||||
*
|
||||
|
@ -354,31 +354,6 @@ class Space extends ContentContainerActiveRecord implements Searchable
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if given user can invite people to this workspace
|
||||
* Note: use directly permission instead
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated since version 1.1
|
||||
*/
|
||||
public function canInvite()
|
||||
{
|
||||
return $this->getPermissionManager()->can(new InviteUsers());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if given user can share content.
|
||||
* Shared Content is public and is visible also for non members of the space.
|
||||
* Note: use directly permission instead
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated since version 1.1
|
||||
*/
|
||||
public function canShare()
|
||||
{
|
||||
return $this->getPermissionManager()->can(new CreatePublicContent());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of informations used by search subsystem.
|
||||
* Function is defined in interface ISearchable
|
||||
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2016 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\modules\space\modules\manage\widgets;
|
||||
|
||||
/**
|
||||
* Menu compatibility
|
||||
*
|
||||
* @see \humhub\modules\space\widgets\HeaderControlsMenu
|
||||
* @deprecated since version 1.1
|
||||
* @author Luke
|
||||
*/
|
||||
class Menu extends \humhub\modules\space\widgets\HeaderControlsMenu
|
||||
{
|
||||
|
||||
}
|
@ -8,25 +8,29 @@
|
||||
|
||||
namespace humhub\modules\space\widgets;
|
||||
|
||||
use Yii;
|
||||
use humhub\modules\space\models\Space;
|
||||
use humhub\modules\space\permissions\InviteUsers;
|
||||
use yii\base\Widget;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/**
|
||||
* SpaceInviteButtonWidget
|
||||
* InviteButton class
|
||||
*
|
||||
* @author luke
|
||||
* @package humhub.modules_core.space.widgets
|
||||
* @since 0.11
|
||||
*/
|
||||
class InviteButton extends Widget
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Space
|
||||
*/
|
||||
public $space;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
if (!$this->space->canInvite()) {
|
||||
if (!$this->space->getPermissionManager()->can(new InviteUsers())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
namespace humhub\modules\user\controllers;
|
||||
|
||||
use humhub\modules\user\Module;
|
||||
use Yii;
|
||||
use yii\web\Controller;
|
||||
use yii\web\HttpException;
|
||||
@ -94,7 +95,11 @@ class InviteController extends Controller
|
||||
*/
|
||||
protected function canInvite()
|
||||
{
|
||||
return Yii::$app->getModule('user')->settings->get('auth.internalUsersCanInvite') || Yii::$app->user->can([new ManageUsers(), new ManageGroups()]);
|
||||
/** @var Module $module */
|
||||
$module = Yii::$app->getModule('user');
|
||||
|
||||
return $module->settings->get('auth.internalUsersCanInvite') ||
|
||||
Yii::$app->user->can([new ManageUsers(), new ManageGroups()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user