This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions

View File

@ -0,0 +1,16 @@
<?php
namespace Nextend\Framework\Acl;
use Nextend\Framework\Pattern\MVCHelperTrait;
abstract class AbstractPlatformAcl {
/**
* @param $action
* @param MVCHelperTrait $MVCHelper
*
* @return bool
*/
abstract public function authorise($action, $MVCHelper);
}

View File

@ -0,0 +1,31 @@
<?php
namespace Nextend\Framework\Acl;
use Nextend\Framework\Acl\Joomla\JoomlaAcl;
use Nextend\Framework\Acl\WordPress\WordPressAcl;
use Nextend\Framework\Pattern\MVCHelperTrait;
class Acl {
/**
* @var AbstractPlatformAcl
*/
private static $instance;
public function __construct() {
self::$instance = new WordPressAcl();
}
/**
* @param $action
* @param MVCHelperTrait $MVCHelper
*
* @return bool
*/
public static function canDo($action, $MVCHelper) {
return self::$instance->authorise($action, $MVCHelper);
}
}
new Acl();

View File

@ -0,0 +1,13 @@
<?php
namespace Nextend\Framework\Acl\WordPress;
use Nextend\Framework\Acl\AbstractPlatformAcl;
use function current_user_can;
class WordPressAcl extends AbstractPlatformAcl {
public function authorise($action, $MVCHelper) {
return current_user_can($action) && current_user_can('unfiltered_html');
}
}