added domain logic for permission checks (#1803)
This commit is contained in:
@@ -150,7 +150,6 @@ class Activity implements EntityWithMetaFields
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal only here for symfony forms
|
||||
* @return Collection|MetaTableTypeInterface[]
|
||||
*/
|
||||
public function getMetaFields(): Collection
|
||||
|
||||
@@ -393,7 +393,6 @@ class Customer implements EntityWithMetaFields
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal only here for symfony forms
|
||||
* @return Collection|MetaTableTypeInterface[]
|
||||
*/
|
||||
public function getMetaFields(): Collection
|
||||
|
||||
@@ -14,7 +14,6 @@ use Doctrine\Common\Collections\Collection;
|
||||
interface EntityWithMetaFields
|
||||
{
|
||||
/**
|
||||
* @internal only here for symfony forms
|
||||
* @return Collection|MetaTableTypeInterface[]
|
||||
*/
|
||||
public function getMetaFields(): Collection;
|
||||
|
||||
@@ -298,7 +298,6 @@ class Project implements EntityWithMetaFields
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal only here for symfony forms
|
||||
* @return Collection|MetaTableTypeInterface[]
|
||||
*/
|
||||
public function getMetaFields(): Collection
|
||||
|
||||
@@ -509,7 +509,6 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal only here for symfony forms
|
||||
* @return Collection|MetaTableTypeInterface[]
|
||||
*/
|
||||
public function getMetaFields(): Collection
|
||||
|
||||
@@ -354,6 +354,11 @@ class User extends BaseUser implements UserInterface
|
||||
$team->removeUser($this);
|
||||
}
|
||||
|
||||
public function hasTeamAssignment(): bool
|
||||
{
|
||||
return !$this->getTeams()->isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<Team>
|
||||
*/
|
||||
@@ -372,6 +377,11 @@ class User extends BaseUser implements UserInterface
|
||||
return $team->getTeamLead() === $this;
|
||||
}
|
||||
|
||||
public function canSeeAllData(): bool
|
||||
{
|
||||
return $this->isSuperAdmin() || $this->isAdmin();
|
||||
}
|
||||
|
||||
public function isTeamlead(): bool
|
||||
{
|
||||
return $this->hasRole(static::ROLE_TEAMLEAD);
|
||||
|
||||
Reference in New Issue
Block a user