Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
open-source
OSE
Commits
acae0900
Commit
acae0900
authored
Nov 12, 2019
by
Laurent Lécluse
Browse files
Correction bug lors de la suppression de rôles
parent
fc30ab9a
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
acae0900
...
...
@@ -10,6 +10,7 @@ author: Laurent Lécluse - DSI - Unicaen
*
Un bug modifiant les paramètres globaux qui avaient été configurés a été résolu
*
La duplication de statuts refonctionne
*
Lors de la création d'un nouveau statut, l'octroi de privilèges ne plante plus
*
La suppression de rôle fonctionne de nouveau correctement
# OSE 9.0.1-zf2 et 9.0.1-zf3
...
...
module/Application/src/Application/Controller/DroitsController.php
View file @
acae0900
...
...
@@ -106,6 +106,9 @@ class DroitsController extends AbstractController
$title
=
"Suppression du rôle"
;
$form
=
$this
->
makeFormSupprimer
(
function
()
use
(
$role
){
$this
->
getServiceRole
()
->
delete
(
$role
);
$this
->
getCacheFilesystem
()
->
delete
(
RoleProvider
::
class
.
'/affectations'
);
$cc
=
$this
->
getCacheContainer
(
PrivilegeService
::
class
);
unset
(
$cc
->
privilegesRoles
);
}
);
return
compact
(
'role'
,
'title'
,
'form'
);
...
...
module/Application/src/Application/Provider/Identity/IdentityProvider.php
View file @
acae0900
...
...
@@ -60,11 +60,18 @@ class IdentityProvider implements ChainableProvider, IdentityProviderInterface
if
(
$utilisateur
=
$this
->
getServiceContext
()
->
getUtilisateur
())
{
foreach
(
$utilisateur
->
getAffectation
()
as
$affectation
)
{
/* @var $affectation Affectation */
$roleId
=
$affectation
->
getRole
()
->
getCode
();
if
(
$structure
=
$affectation
->
getStructure
())
{
$roleId
.
=
'-'
.
$structure
->
getSourceCode
();
$role
=
$affectation
->
getRole
();
try
{
$roleId
=
$role
->
getCode
();
if
(
$role
->
estNonHistorise
())
{
if
(
$structure
=
$affectation
->
getStructure
())
{
$roleId
.
=
'-'
.
$structure
->
getSourceCode
();
}
$this
->
identityRoles
[]
=
$roleId
;
}
}
catch
(
\
Exception
$e
){
// on ignore les affectations dont les rôles ont été supprimés
}
$this
->
identityRoles
[]
=
$roleId
;
}
}
...
...
module/Application/src/Application/Provider/Role/RoleProvider.php
View file @
acae0900
...
...
@@ -155,7 +155,7 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface
/* @var $affectation Affectation */
if
(
$structure
=
$affectation
->
getStructure
())
{
$affRoleId
=
$roleId
.
'-'
.
$structure
->
getSourceCode
();
if
(
!
isset
(
$roles
[
$affRoleId
]))
{
if
(
!
isset
(
$roles
[
$affRoleId
])
&&
$dbRole
->
estNonHistorise
()
)
{
$affRoleLibelle
=
$dbRole
->
getLibelle
()
.
' ('
.
$structure
->
getLibelleCourt
()
.
')'
;
$affRole
=
new
\
Application\Acl\Role
(
$affRoleId
,
$roleId
,
$affRoleLibelle
);
if
(
isset
(
$rolesPrivileges
[
$roleId
]))
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment