Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
b7931398
Commit
b7931398
authored
Dec 01, 2015
by
Laurent Lécluse
Browse files
Correction de bug
parent
bff5eb57
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Service/UserContext.php
View file @
b7931398
...
...
@@ -88,6 +88,23 @@ class UserContext extends AbstractService
/**
* @param string $roleId
*
* @return Role
*/
public
function
getIdentityRole
(
$roleId
)
{
$roles
=
$this
->
getServiceAuthorize
()
->
getRoles
();
if
(
isset
(
$roles
[
$roleId
]))
{
return
$roles
[
$roleId
];
}
return
null
;
}
/**
* Retourne tous les rôles de l'utilisateur courant, pas seulement le rôle courant sélectionné.
*
...
...
src/UnicaenAuth/View/Helper/UserCurrent.php
View file @
b7931398
...
...
@@ -44,10 +44,8 @@ class UserCurrent extends UserAbstract
if
(
$this
->
getIdentity
())
{
if
(
$userProfileSelectable
)
{
// DS : cas où aucun rôle n'est sélectionné, on affiche le rôle "user"
$role
=
(
null
!==
$this
->
getUserContext
()
->
getSelectedIdentityRole
())
?
$this
->
getUserContext
()
->
getSelectedIdentityRole
()
:
$this
->
getUserContext
()
->
getIdentityRoles
()[
'user'
];
// DS : cas où aucun rôle n'est sélectionné, on affiche le rôle "user"
$role
=
$this
->
getUserContext
()
->
getSelectedIdentityRole
()
?:
$this
->
getUserContext
()
->
getIdentityRole
(
'user'
);
$status
.
=
sprintf
(
", <small>%s</small>"
,
!
method_exists
(
$role
,
'__toString'
)
?
$role
->
getRoleId
()
:
$role
);
}
...
...
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