Removed hasRole twig function
This commit is contained in:
1 parent
3d21ab4950
commit
b7d15dc25e
1 file changed
+1
-5
@@ -66,18 +66,14 @@ class OrganisationsExtension extends AbstractExtension implements GlobalsInterfa
|
||||
return Capsule::table('organisation_members')
|
||||
->where('user_id', $currentUser->id)
|
||||
->where('organisation_id', $organisation->id)
|
||||
->where('flag_admin', true)
|
||||
->where('flag_approved', true)
|
||||
->where('flag_admin', true)
|
||||
->count() > 0;
|
||||
}),
|
||||
new TwigFunction('isOrganisationRegistrant', function ($organisation) {
|
||||
$currentUser = $this->services->currentUser;
|
||||
return $organisation->registrant_id == $currentUser->id;
|
||||
}),
|
||||
new TwigFunction('hasRole', function ($roleSlug) {
|
||||
$currentUser = $this->services->currentUser;
|
||||
return $currentUser->roles()->where('slug', $roleSlug)->count() > 0;
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user