Compare commits
2
Commits
cd12ac72c7
...
daa4e78a27
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
daa4e78a27 | ||
|
|
1e0f2017f6 |
No files matched your search
@@ -124,7 +124,7 @@ trait UserOrganisations {
|
||||
}
|
||||
|
||||
|
||||
public function bootUserOrganisations()
|
||||
static public function bootUserOrganisations()
|
||||
{
|
||||
static::deleting(function ($user) {
|
||||
if (!$user->deleteUserOrganisations($user->isForceDeleting())) {
|
||||
|
||||
@@ -67,8 +67,10 @@ class ServicesProvider
|
||||
*/
|
||||
$authorizer->addCallback('has_organisation', function ($user_id) {
|
||||
$query = Capsule::table('organisation_members')
|
||||
->join('organisations', 'organisation_members.organisation_id', 'organisations.id')
|
||||
->where('user_id', $user_id)
|
||||
->where('flag_approved', true);
|
||||
->where('organisation_members.flag_approved', true)
|
||||
->where('organisations.flag_approved', true);
|
||||
|
||||
return $query->count() > 0;
|
||||
});
|
||||
@@ -104,8 +106,9 @@ class ServicesProvider
|
||||
return Capsule::table('organisation_members')
|
||||
->where('user_id', $user_id)
|
||||
->where('organisation_id', $organisation_id)
|
||||
->where('flag_admin', true)
|
||||
->count() > 0;
|
||||
->where('flag_admin', true);
|
||||
|
||||
return $query->count() > 0;
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user