administrators management

This commit is contained in:
Etienne Roudeix
2013-10-23 16:31:37 +02:00
parent 3c69e38a3b
commit fb8b82093a
16 changed files with 1033 additions and 46 deletions

View File

@@ -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();

View File

@@ -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