mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
This commit is contained in:
parent
5872e23562
commit
19c5111170
2 changed files with 29 additions and 4 deletions
|
@ -2571,11 +2571,12 @@ if (typeof gtag !== \"function\") {
|
|||
|
||||
public static function canCreateMeet()
|
||||
{
|
||||
global $global, $config;
|
||||
if (self::isLogged() && !empty($_SESSION['user']['canCreateMeet'])) {
|
||||
return true;
|
||||
$p = AVideoPlugin::isEnabledByName('Meet');
|
||||
if(empty($p)){
|
||||
return false;
|
||||
}
|
||||
return self::isAdmin();
|
||||
|
||||
return Meet::canCreateMeet();
|
||||
}
|
||||
|
||||
public static function canComment()
|
||||
|
|
|
@ -15,6 +15,8 @@ User::loginFromRequestIfNotLogged();
|
|||
//use \Firebase\JWT\JWT;
|
||||
class Meet extends PluginAbstract
|
||||
{
|
||||
const PERMISSION_CAN_CREATE_MEET = 0;
|
||||
|
||||
public function getTags()
|
||||
{
|
||||
return [
|
||||
|
@ -694,4 +696,26 @@ Passcode: {password}
|
|||
$buttonTitle = $obj->buttonTitle;
|
||||
include $global['systemRootPath'] . 'plugin/Meet/getUploadMenuButton.php';
|
||||
}
|
||||
|
||||
function getPermissionsOptions()
|
||||
{
|
||||
$permissions = array();
|
||||
|
||||
$permissions[] = new PluginPermissionOption(self::PERMISSION_CAN_CREATE_MEET, __("Can create meetings"), "Members of the designated user group will have access create meetings", 'Meet');
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
static function canCreateMeet()
|
||||
{
|
||||
|
||||
if (User::isAdmin() || isCommandLineInterface()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!User::isLogged()){
|
||||
return false;
|
||||
}
|
||||
|
||||
return !empty($_SESSION['user']['canCreateMeet']) || Permissions::hasPermission(self::PERMISSION_CAN_CREATE_MEET, 'Meet');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue