Tighten some more permissions down

This commit is contained in:
bwilliams committed 2022-02-10 18:11:42 +00:00
1 parent 909b6a93dc
commit 575aa68bca
3 files changed
+29 -1

No files matched your search

+4
View File
@@ -62,6 +62,10 @@ class OrganisationsExtension extends AbstractExtension implements GlobalsInterfa
return $authorizer->runCallback($currentUser, 'is_organisation_admin', $currentUser->id, $organisation->id);
}),
new TwigFunction('hasRole', function ($roleSlug) {
$currentUser = $this->services->currentUser;
return $currentUser->roles()->where('slug', $roleSlug)->count() > 0;
}),
];
}