mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#3267 emlak24 feb. issues
This commit is contained in:
parent
b95d4ebf87
commit
b863534f49
@ -0,0 +1,18 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Profile\Command;
|
||||
|
||||
use Anomaly\Streams\Platform\Support\Authorizer;
|
||||
|
||||
class Authorize
|
||||
{
|
||||
protected $permission;
|
||||
|
||||
public function __construct($permission)
|
||||
{
|
||||
$this->permission = $permission;
|
||||
}
|
||||
|
||||
public function handle(Authorizer $authorizer)
|
||||
{
|
||||
return $authorizer->authorize($this->permission);
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@
|
||||
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
||||
use Visiosoft\ProfileModule\Adress\Command\GetAddress;
|
||||
use Visiosoft\ProfileModule\Adress\Command\GetAddressByUser;
|
||||
use Visiosoft\ProfileModule\Profile\Command\Authorize;
|
||||
use Visiosoft\ProfileModule\Profile\Command\GetProfileDetail;
|
||||
|
||||
class ProfileModulePlugin extends Plugin
|
||||
@ -45,6 +46,12 @@ class ProfileModulePlugin extends Plugin
|
||||
|
||||
return $ad;
|
||||
}
|
||||
),
|
||||
new \Twig_SimpleFunction(
|
||||
'authorize',
|
||||
function ($permission) {
|
||||
return $this->dispatch(new Authorize($permission));
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user