Skip to content
Snippets Groups Projects
Commit e24bdb87 authored by Tom Caillaud's avatar Tom Caillaud
Browse files

fix services on users

parent 25a3608e
No related branches found
No related tags found
1 merge request!200fix services on users
Pipeline #19164 passed
...@@ -31,3 +31,4 @@ yarn-error.log ...@@ -31,3 +31,4 @@ yarn-error.log
###> lexik/jwt-authentication-bundle ### ###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem /config/jwt/*.pem
###< lexik/jwt-authentication-bundle ### ###< lexik/jwt-authentication-bundle ###
.history
\ No newline at end of file
...@@ -24,6 +24,7 @@ declare(strict_types=1); ...@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace App\Domain\User\Model; namespace App\Domain\User\Model;
use App\Application\Interfaces\CollectivityRelated;
use App\Application\Traits\Model\SoftDeletableTrait; use App\Application\Traits\Model\SoftDeletableTrait;
use App\Domain\Reporting\Model\LoggableSubject; use App\Domain\Reporting\Model\LoggableSubject;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
...@@ -31,7 +32,7 @@ use Ramsey\Uuid\Uuid; ...@@ -31,7 +32,7 @@ use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface; use Ramsey\Uuid\UuidInterface;
use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserInterface;
class User implements LoggableSubject, UserInterface class User implements LoggableSubject, UserInterface, CollectivityRelated
{ {
use SoftDeletableTrait; use SoftDeletableTrait;
...@@ -285,4 +286,19 @@ class User implements LoggableSubject, UserInterface ...@@ -285,4 +286,19 @@ class User implements LoggableSubject, UserInterface
{ {
$this->apiAuthorized = $apiAuthorized; $this->apiAuthorized = $apiAuthorized;
} }
public function isInUserServices(User $user): bool
{
if (false == $user->getCollectivity()->getIsServicesEnabled()) {
return true;
}
$result = false;
if ($user->getServices() === $this->getServices()) {
$result = true;
}
return $result;
}
} }
...@@ -42,14 +42,16 @@ ...@@ -42,14 +42,16 @@
</div> </div>
</div> </div>
<div class="box box-solid box-success"> {% if serviceEnabled %}
<div class="box-header with-border"> <div class="box box-solid box-success">
<h3 class="box-title">{{ 'user.user.tab.services'|trans }}</h3> <div class="box-header with-border">
</div> <h3 class="box-title">{{ 'user.user.tab.services'|trans }}</h3>
<div class="box-body"> </div>
{{ form_row(form.services) }} <div class="box-body">
{{ form_row(form.services) }}
</div>
</div> </div>
</div> {% endif %}
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment