mirror of
https://github.com/typemill/typemill.git
synced 2025-08-06 14:16:46 +02:00
Version 1.3.8: ACL Integration
This commit is contained in:
@@ -8,6 +8,7 @@ class TwigUserExtension extends \Twig_Extension
|
||||
{
|
||||
return [
|
||||
new \Twig_SimpleFunction('is_role', array($this, 'isRole' )),
|
||||
new \Twig_SimpleFunction('get_role', array($this, 'getRole' )),
|
||||
new \Twig_SimpleFunction('get_username', array($this, 'getUsername' ))
|
||||
];
|
||||
}
|
||||
@@ -21,6 +22,15 @@ class TwigUserExtension extends \Twig_Extension
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getRole()
|
||||
{
|
||||
if(isset($_SESSION['role']))
|
||||
{
|
||||
return $_SESSION['role'];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getUsername()
|
||||
{
|
||||
|
Reference in New Issue
Block a user