New user groups and memberships

This commit is contained in:
James Cole
2021-08-28 15:47:33 +02:00
parent a14c9438ad
commit 10787aada8
12 changed files with 483 additions and 8 deletions

View File

@@ -34,6 +34,7 @@ use FireflyIII\Models\Bill;
use FireflyIII\Models\Budget;
use FireflyIII\Models\Category;
use FireflyIII\Models\CurrencyExchangeRate;
use FireflyIII\Models\GroupMembership;
use FireflyIII\Models\ObjectGroup;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\Preference;
@@ -136,14 +137,14 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @method static Builder|User whereObjectguid($value)
* @property string|null $provider
* @method static Builder|User whereProvider($value)
* @property-read \Illuminate\Database\Eloquent\Collection|ObjectGroup[] $objectGroups
* @property-read int|null $object_groups_count
* @property-read \Illuminate\Database\Eloquent\Collection|Webhook[] $webhooks
* @property-read int|null $webhooks_count
* @property string|null $two_factor_secret
* @property string|null $two_factor_recovery_codes
* @property string|null $guid
* @property string|null $domain
* @property-read \Illuminate\Database\Eloquent\Collection|ObjectGroup[] $objectGroups
* @property-read int|null $object_groups_count
* @property-read \Illuminate\Database\Eloquent\Collection|Webhook[] $webhooks
* @property-read int|null $webhooks_count
* @property string|null $two_factor_secret
* @property string|null $two_factor_recovery_codes
* @property string|null $guid
* @property string|null $domain
* @method static Builder|User whereDomain($value)
* @method static Builder|User whereGuid($value)
* @method static Builder|User whereTwoFactorRecoveryCodes($value)
@@ -212,6 +213,16 @@ class User extends Authenticatable
return $this->hasMany(Account::class);
}
/**
* @codeCoverageIgnore
*
* @return HasMany
*/
public function groupMemberships(): HasMany
{
return $this->hasMany(GroupMembership::class)->with(['userGroup','userRole']);
}
/**
* @codeCoverageIgnore
* Link to attachments
@@ -449,6 +460,7 @@ class User extends Authenticatable
}
// start LDAP related code
/**
* Get the database column name of the domain.
*