Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
auth
Commits
b2842c20
Commit
b2842c20
authored
Dec 1, 2015
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
Correction de bug si on utilise un IdentityProvider spécifique.
Nouvelle config par défaut
parent
fa2d34ad
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/unicaen-auth.global.php.dist
+84
-67
84 additions, 67 deletions
config/unicaen-auth.global.php.dist
src/UnicaenAuth/Service/UserContext.php
+6
-1
6 additions, 1 deletion
src/UnicaenAuth/Service/UserContext.php
with
90 additions
and
68 deletions
config/unicaen-auth.global.php.dist
+
84
−
67
View file @
b2842c20
...
@@ -18,9 +18,11 @@ $settings = [
...
@@ -18,9 +18,11 @@ $settings = [
*/
*/
'enable_registration'
=>
false
,
'enable_registration'
=>
false
,
'enable_privileges'
=>
true
,
];
];
return
[
$config
=
[
'unicaen-auth'
=>
$settings
,
'unicaen-auth'
=>
$settings
,
'bjyauthorize'
=>
[
'bjyauthorize'
=>
[
/* this module uses a meta-role that inherits from any roles that should
/* this module uses a meta-role that inherits from any roles that should
...
@@ -50,6 +52,15 @@ return [
...
@@ -50,6 +52,15 @@ return [
*/
*/
'UnicaenAuth\Provider\Role\Username'
=>
[],
'UnicaenAuth\Provider\Role\Username'
=>
[],
],
],
],
'zfcuser'
=>
[
$k
=
'enable_registration'
=>
isset
(
$settings
[
$k
])
?
$settings
[
$k
]
:
false
,
],
];
if
(
$settings
[
'enable_privileges'
])
{
$privileges
=
[
'bjyauthorize'
=>
[
'resource_providers'
=>
[
'resource_providers'
=>
[
/**
/**
...
@@ -59,42 +70,43 @@ return [
...
@@ -59,42 +70,43 @@ return [
'UnicaenAuth\Service\Privilege'
=>
[],
'UnicaenAuth\Service\Privilege'
=>
[],
],
],
'rule_providers'
=>
[
'UnicaenAuth\Provider\Rule\PrivilegeRuleProvider'
=>
[],
],
'guards'
=>
[
'guards'
=>
[
'UnicaenAuth\Guard\PrivilegeController'
=>
[
'UnicaenAuth\Guard\PrivilegeController'
=>
[
[
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'index'
],
'action'
=>
[
'index'
],
'privileges'
=>
[
'privileges'
=>
[
Privileges
::
DROIT_ROLE_VISUALISATION
,
\UnicaenAuth\Provider\Privilege\
Privileges
::
DROIT_ROLE_VISUALISATION
,
Privileges
::
DROIT_PRIVILEGE_VISUALISATION
,
\UnicaenAuth\Provider\Privilege\
Privileges
::
DROIT_PRIVILEGE_VISUALISATION
,
],
],
],
],
[
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'roles'
],
'action'
=>
[
'roles'
],
'privileges'
=>
[
Privileges
::
DROIT_ROLE_VISUALISATION
],
'privileges'
=>
[
\UnicaenAuth\Provider\Privilege\
Privileges
::
DROIT_ROLE_VISUALISATION
],
],
],
[
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'privileges'
],
'action'
=>
[
'privileges'
],
'privileges'
=>
[
Privileges
::
DROIT_PRIVILEGE_VISUALISATION
],
'privileges'
=>
[
\UnicaenAuth\Provider\Privilege\
Privileges
::
DROIT_PRIVILEGE_VISUALISATION
],
],
],
[
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'role-edition'
,
'role-suppression'
],
'action'
=>
[
'role-edition'
,
'role-suppression'
],
'privileges'
=>
[
Privileges
::
DROIT_ROLE_EDITION
],
'privileges'
=>
[
\UnicaenAuth\Provider\Privilege\
Privileges
::
DROIT_ROLE_EDITION
],
],
],
[
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'privileges-modifier'
],
'action'
=>
[
'privileges-modifier'
],
'privileges'
=>
[
Privileges
::
DROIT_PRIVILEGE_EDITION
],
'privileges'
=>
[
\UnicaenAuth\Provider\Privilege\
Privileges
::
DROIT_PRIVILEGE_EDITION
],
],
],
],
],
],
],
],
],
'zfcuser'
=>
[
$k
=
'enable_registration'
=>
isset
(
$settings
[
$k
])
?
$settings
[
$k
]
:
false
,
],
'navigation'
=>
[
'navigation'
=>
[
// The DefaultNavigationFactory we configured uses 'default' as the sitemap key
// The DefaultNavigationFactory we configured uses 'default' as the sitemap key
'default'
=>
[
'default'
=>
[
...
@@ -128,3 +140,8 @@ return [
...
@@ -128,3 +140,8 @@ return [
],
],
],
],
];
];
}
else
{
$privileges
=
[];
}
return
array_merge_recursive
(
$config
,
$privileges
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/UnicaenAuth/Service/UserContext.php
+
6
−
1
View file @
b2842c20
...
@@ -4,6 +4,7 @@ namespace UnicaenAuth\Service;
...
@@ -4,6 +4,7 @@ namespace UnicaenAuth\Service;
use
UnicaenApp\Exception\RuntimeException
;
use
UnicaenApp\Exception\RuntimeException
;
use
UnicaenApp\Traits\SessionContainerTrait
;
use
UnicaenApp\Traits\SessionContainerTrait
;
use
UnicaenAuth\Provider\Identity\Chain
;
use
Zend\Session\Container
as
SessionContainer
;
use
Zend\Session\Container
as
SessionContainer
;
use
Zend\Permissions\Acl\Role\RoleInterface
;
use
Zend\Permissions\Acl\Role\RoleInterface
;
use
ZfcUser\Entity\UserInterface
;
use
ZfcUser\Entity\UserInterface
;
...
@@ -95,7 +96,11 @@ class UserContext extends AbstractService
...
@@ -95,7 +96,11 @@ class UserContext extends AbstractService
{
{
if
(
null
===
$this
->
identityRoles
)
{
if
(
null
===
$this
->
identityRoles
)
{
$identityProvider
=
$this
->
getIdentityProvider
();
$identityProvider
=
$this
->
getIdentityProvider
();
if
(
$identityProvider
instanceof
Chain
){
$this
->
identityRoles
=
$identityProvider
->
getAllIdentityRoles
();
$this
->
identityRoles
=
$identityProvider
->
getAllIdentityRoles
();
}
else
{
$this
->
identityRoles
=
$identityProvider
->
getIdentityRoles
();
}
}
}
return
$this
->
identityRoles
;
return
$this
->
identityRoles
;
...
...
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