Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monnaies-locales
kohinos
Commits
e0839f9a
You need to sign in or sign up before continuing.
Commit
e0839f9a
authored
Oct 26, 2020
by
Mathieu Poisbeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#206: en admin, trésoriers et admins siège peuvent "voir les comptoirs"
(en lecture seule, c-à-d en mode LIST et VIEW)
parent
704e5af3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
security.yaml
config/packages/security.yaml
+8
-5
ComptoirAdmin.php
src/Admin/ComptoirAdmin.php
+3
-1
No files found.
config/packages/security.yaml
View file @
e0839f9a
...
@@ -96,7 +96,7 @@ security:
...
@@ -96,7 +96,7 @@ security:
switch_user
:
switch_user
:
provider
:
fos_userbundle
provider
:
fos_userbundle
# access_denied_handler: App\Security\AccessDeniedHandler
# access_denied_handler: App\Security\AccessDeniedHandler
encoders
:
encoders
:
# FOS\UserBundle\Model\UserInterface: bcrypt
# FOS\UserBundle\Model\UserInterface: bcrypt
FOS\UserBundle\Model\UserInterface
:
FOS\UserBundle\Model\UserInterface
:
...
@@ -109,22 +109,25 @@ security:
...
@@ -109,22 +109,25 @@ security:
ROLE_API
:
ROLE_USER
ROLE_API
:
ROLE_USER
ROLE_ADHERENT
:
ROLE_USER
ROLE_ADHERENT
:
ROLE_USER
ROLE_PRESTATAIRE
:
ROLE_USER
ROLE_PRESTATAIRE
:
ROLE_USER
ROLE_ADMIN_SIEGE
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_ADMIN_SIEGE
:
[
ROLE_USER
,
ROLE_ADMIN
,
ROLE_ADMIN_COMPTOIR_READER
]
ROLE_REDACTEUR
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_REDACTEUR
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_TRESORIER
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_TRESORIER
:
[
ROLE_USER
,
ROLE_ADMIN
,
ROLE_ADMIN_COMPTOIR_READER
]
ROLE_CONTROLEUR
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_CONTROLEUR
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_GESTION_GROUPE
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_GESTION_GROUPE
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_COMPTOIR
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_COMPTOIR
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_CONTACT
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_CONTACT
:
[
ROLE_USER
,
ROLE_ADMIN
]
ROLE_ADMIN
:
[
ROLE_USER
,
ROLE_SONATA_ADMIN
]
ROLE_ADMIN
:
[
ROLE_USER
,
ROLE_SONATA_ADMIN
]
ROLE_ADMIN_COMPTOIR_READER
:
-
ROLE_ADMIN_COMPTOIR_GERER_LIST
-
ROLE_ADMIN_COMPTOIR_GERER_VIEW
ROLE_SUPER_ADMIN
:
[
ROLE_ADMIN
,
ROLE_ALLOWED_TO_SWITCH
,
ROLE_API
]
ROLE_SUPER_ADMIN
:
[
ROLE_ADMIN
,
ROLE_ALLOWED_TO_SWITCH
,
ROLE_API
]
# Easy way to control access for large sections of your site
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
# Note: Only the *first* access control that matches will be used
access_control
:
access_control
:
#
#
# @TODO : better access control !
# @TODO : better access control !
#
#
# Admin login page needs to be accessed without credential
# Admin login page needs to be accessed without credential
# - { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
# - { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
# - { path: ^/admin/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
# - { path: ^/admin/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
...
...
src/Admin/ComptoirAdmin.php
View file @
e0839f9a
...
@@ -53,7 +53,9 @@ class ComptoirAdmin extends AbstractAdmin
...
@@ -53,7 +53,9 @@ class ComptoirAdmin extends AbstractAdmin
$query
=
parent
::
createQuery
(
$context
);
$query
=
parent
::
createQuery
(
$context
);
$user
=
$this
->
security
->
getUser
();
$user
=
$this
->
security
->
getUser
();
if
(
empty
(
$this
->
getRequest
()
->
getSession
()
->
get
(
'_groupegere'
)))
{
if
(
empty
(
$this
->
getRequest
()
->
getSession
()
->
get
(
'_groupegere'
)))
{
if
(
$user
->
isGranted
(
'ROLE_GESTION_GROUPE'
)
||
$user
->
isGranted
(
'ROLE_CONTACT'
)
||
$user
->
isGranted
(
'ROLE_TRESORIER'
))
{
// TODO: Pourquoi empêcher toutes les "requêtes comptoir" pour ces rôles ?
//if ($user->isGranted('ROLE_GESTION_GROUPE') || $user->isGranted('ROLE_CONTACT') || $user->isGranted('ROLE_TRESORIER')) {
if
(
$user
->
isGranted
(
'ROLE_GESTION_GROUPE'
)
||
$user
->
isGranted
(
'ROLE_CONTACT'
))
{
$query
->
andWhere
(
'false = true'
);
$query
->
andWhere
(
'false = true'
);
}
}
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment