|
@@ -6,17 +6,29 @@ namespace ChamiloLMS\Component\Auth;
|
|
|
*/
|
|
|
|
|
|
use Symfony\Component\Security\Core\Role\RoleInterface;
|
|
|
-use Symfony\Component\Security\Core\User\UserInterface;
|
|
|
+use Symfony\Component\Security\Core\User\AdvancedUserInterface;
|
|
|
|
|
|
class Role implements RoleInterface
|
|
|
{
|
|
|
- public function __construct(UserInterface $user)
|
|
|
+ private $user;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param AdvancedUserInterface $user
|
|
|
+ */
|
|
|
+ public function __construct(AdvancedUserInterface $user)
|
|
|
{
|
|
|
$this->user = $user;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
public function getRole()
|
|
|
{
|
|
|
- //return 'ROLE_' . strtoupper($this->user->getUsername());
|
|
|
+ /*$globalPlatform = api_is_global_platform_admin($this->user->getUserId());
|
|
|
+ if ($globalPlatform) {
|
|
|
+ //return 'ROLE_GLOBAL_ADMIN';
|
|
|
+ }*/
|
|
|
+
|
|
|
}
|
|
|
}
|