Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
madis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Soluris
madis
Commits
e24bdb87
Commit
e24bdb87
authored
3 years ago
by
Tom Caillaud
Browse files
Options
Downloads
Patches
Plain Diff
fix services on users
parent
25a3608e
No related branches found
No related tags found
1 merge request
!200
fix services on users
Pipeline
#19164
passed
3 years ago
Stage: cache
Stage: tests
Stage: quality-assurance
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
src/Domain/User/Model/User.php
+17
-1
17 additions, 1 deletion
src/Domain/User/Model/User.php
templates/User/User/_form.html.twig
+9
-7
9 additions, 7 deletions
templates/User/User/_form.html.twig
with
27 additions
and
8 deletions
.gitignore
+
1
−
0
View file @
e24bdb87
...
@@ -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
This diff is collapsed.
Click to expand it.
src/Domain/User/Model/User.php
+
17
−
1
View file @
e24bdb87
...
@@ -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
;
}
}
}
This diff is collapsed.
Click to expand it.
templates/User/User/_form.html.twig
+
9
−
7
View file @
e24bdb87
...
@@ -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"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment