administrators management
This commit is contained in:
@@ -10,6 +10,7 @@ use Thelia\Core\Security\Role\Role;
|
||||
|
||||
use Thelia\Model\Base\Admin as BaseAdmin;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'admin' table.
|
||||
@@ -24,6 +25,8 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
||||
*/
|
||||
class Admin extends BaseAdmin implements UserInterface
|
||||
{
|
||||
use ModelEventDispatcherTrait;
|
||||
|
||||
public function getPermissions()
|
||||
{
|
||||
$profileId = $this->getProfileId();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Core\Security\Resource\AdminResources;
|
||||
use Thelia\Model\Base\ProfileQuery as BaseProfileQuery;
|
||||
|
||||
|
||||
@@ -17,5 +18,14 @@ use Thelia\Model\Base\ProfileQuery as BaseProfileQuery;
|
||||
*/
|
||||
class ProfileQuery extends BaseProfileQuery
|
||||
{
|
||||
|
||||
public static function getProfileList()
|
||||
{
|
||||
$profileList = array(
|
||||
0 => AdminResources::SUPERADMINISTRATOR,
|
||||
);
|
||||
foreach(ProfileQuery::create()->find() as $profile) {
|
||||
$profileList[$profile->getId()] = $profile->getCode();
|
||||
}
|
||||
return $profileList;
|
||||
}
|
||||
} // ProfileQuery
|
||||
|
||||
Reference in New Issue
Block a user