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
fa2d34ad
Commit
fa2d34ad
authored
Dec 1, 2015
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
Possibilité de désactiver le nouveau système de privilèges si on ne s'en sert pas
parent
2b13a20f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Module.php
+0
-35
0 additions, 35 deletions
Module.php
config/module.config.php
+0
-57
0 additions, 57 deletions
config/module.config.php
config/unicaen-auth.global.php.dist
+109
-13
109 additions, 13 deletions
config/unicaen-auth.global.php.dist
with
109 additions
and
105 deletions
Module.php
+
0
−
35
View file @
fa2d34ad
...
@@ -142,39 +142,4 @@ class Module implements ConfigProviderInterface, ServiceProviderInterface
...
@@ -142,39 +142,4 @@ class Module implements ConfigProviderInterface, ServiceProviderInterface
],
],
];
];
}
}
/**
* Retourne le menu de navigation (à placer où vous voulez)!!
*
* @return array
*/
static
public
function
getDroitsNavigation
(
$label
=
null
,
$title
=
null
)
{
if
(
!
$label
)
$label
=
"Droits d'accès"
;
if
(
!
$title
)
$title
=
"Gestion des droits d'accès"
;
return
[
'label'
=>
$label
,
'title'
=>
$title
,
'route'
=>
'droits'
,
'resource'
=>
PrivilegeController
::
getResourceId
(
'UnicaenAuth\Controller\Droits'
,
'index'
),
'pages'
=>
[
'roles'
=>
[
'label'
=>
"Rôles"
,
'title'
=>
"Gestion des rôles"
,
'route'
=>
'droits/roles'
,
'resource'
=>
PrivilegeController
::
getResourceId
(
'UnicaenAuth\Controller\Droits'
,
'roles'
),
'withtarget'
=>
true
,
],
'privileges'
=>
[
'label'
=>
"Privilèges"
,
'title'
=>
"Gestion des privilèges"
,
'route'
=>
'droits/privileges'
,
'resource'
=>
PrivilegeController
::
getResourceId
(
'UnicaenAuth\Controller\Droits'
,
'privileges'
),
'withtarget'
=>
true
,
],
],
];
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
config/module.config.php
+
0
−
57
View file @
fa2d34ad
...
@@ -77,13 +77,6 @@ return [
...
@@ -77,13 +77,6 @@ return [
'enable_default_entities'
=>
false
,
'enable_default_entities'
=>
false
,
],
],
'bjyauthorize'
=>
[
'bjyauthorize'
=>
[
/* this module uses a meta-role that inherits from any roles that should
* be applied to the active user. the identity provider tells us which
* roles the "identity role" should inherit from.
*
* for ZfcUser, this will be your default identity provider
*/
'identity_provider'
=>
'UnicaenAuth\Provider\Identity\Chain'
,
/* role providers simply provide a list of roles that should be inserted
/* role providers simply provide a list of roles that should be inserted
* into the Zend\Acl instance. the module comes with two providers, one
* into the Zend\Acl instance. the module comes with two providers, one
...
@@ -101,26 +94,6 @@ return [
...
@@ -101,26 +94,6 @@ return [
'user'
=>
[
'name'
=>
"Authentifié(e)"
,
'selectable'
=>
false
],
'user'
=>
[
'name'
=>
"Authentifié(e)"
,
'selectable'
=>
false
],
]],
]],
],
],
/**
* Fournit les rôles issus de la base de données éventuelle de l'appli.
* NB: si le rôle par défaut 'guest' est fourni ici, il ne sera pas ajouté en double dans les ACL.
* NB: si la connexion à la base échoue, ce n'est pas bloquant!
*/
'UnicaenAuth\Provider\Role\DbRole'
=>
[],
/**
* Fournit le rôle correspondant à l'identifiant de connexion de l'utilisateur.
* Cela est utile lorsque l'on veut gérer les habilitations d'un utilisateur unique
* sur des ressources.
*/
'UnicaenAuth\Provider\Role\Username'
=>
[],
],
'rule_providers'
=>
[
//'UnicaenAuth\Provider\Rule\PrivilegeRuleProvider' => [],
],
'resource_providers'
=>
[
'UnicaenAuth\Service\Privilege'
=>
[],
],
],
// strategy service name for the strategy listener to be used when permission-related errors are detected
// strategy service name for the strategy listener to be used when permission-related errors are detected
...
@@ -148,36 +121,6 @@ return [
...
@@ -148,36 +121,6 @@ return [
[
'controller'
=>
'UnicaenApp\Controller\Application'
,
'action'
=>
'refresh-session'
,
'roles'
=>
[]],
[
'controller'
=>
'UnicaenApp\Controller\Application'
,
'action'
=>
'refresh-session'
,
'roles'
=>
[]],
[
'controller'
=>
'UnicaenAuth\Controller\Utilisateur'
,
'action'
=>
'selectionner-profil'
,
'roles'
=>
[]],
[
'controller'
=>
'UnicaenAuth\Controller\Utilisateur'
,
'action'
=>
'selectionner-profil'
,
'roles'
=>
[]],
],
],
'UnicaenAuth\Guard\PrivilegeController'
=>
[
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'index'
],
'privileges'
=>
[
Privileges
::
DROIT_ROLE_VISUALISATION
,
Privileges
::
DROIT_PRIVILEGE_VISUALISATION
,
],
],
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'roles'
],
'privileges'
=>
[
Privileges
::
DROIT_ROLE_VISUALISATION
],
],
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'privileges'
],
'privileges'
=>
[
Privileges
::
DROIT_PRIVILEGE_VISUALISATION
],
],
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'role-edition'
,
'role-suppression'
],
'privileges'
=>
[
Privileges
::
DROIT_ROLE_EDITION
],
],
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'privileges-modifier'
],
'privileges'
=>
[
Privileges
::
DROIT_PRIVILEGE_EDITION
],
],
],
],
],
],
],
'unicaen-auth'
=>
$settings
,
'unicaen-auth'
=>
$settings
,
...
...
This diff is collapsed.
Click to expand it.
config/unicaen-auth.global.php.dist
+
109
−
13
View file @
fa2d34ad
<?php
<?php
/**
/**
*
Configuration globale du module UnicaenAuth.
*
UnicaenAuth Global Configuration
*
*
* If you have a ./config/autoload/ directory set up for your project, you can
* If you have a ./config/autoload/ directory set up for your project, you can
* drop this config file in it and change the values as you wish.
* drop this config file in it and change the values as you wish.
...
@@ -12,23 +12,119 @@ $settings = [
...
@@ -12,23 +12,119 @@ $settings = [
*/
*/
'save_ldap_user_in_database'
=>
false
,
'save_ldap_user_in_database'
=>
false
,
/**
/**
* Flag indiquant si l'utilisateur peut s'enregistrer auprès de l'application
* Enable registration
* (i.e. créer un compte dans la table des utilisateurs).
* Allows users to register through the website.
* Accepted values: boolean true or false
*/
*/
'enable_registration'
=>
false
,
'enable_registration'
=>
false
,
];
return
[
'unicaen-auth'
=>
$settings
,
'bjyauthorize'
=>
[
/* this module uses a meta-role that inherits from any roles that should
* be applied to the active user. the identity provider tells us which
* roles the "identity role" should inherit from.
*
* for ZfcUser, this will be your default identity provider
*/
'identity_provider'
=>
'UnicaenAuth\Provider\Identity\Chain'
,
/* role providers simply provide a list of roles that should be inserted
* into the Zend\Acl instance. the module comes with two providers, one
* to specify roles in a config file and one to load roles using a
* Zend\Db adapter.
*/
'role_providers'
=>
[
/**
/**
* Nom du gestionnaire d'entités doctrine qui sera utilisé pour accéder à la base de données des rôles,
* Fournit les rôles issus de la base de données éventuelle de l'appli.
* utilisateurs et privilèges.
* NB: si le rôle par défaut 'guest' est fourni ici, il ne sera pas ajouté en double dans les ACL.
* NB: si la connexion à la base échoue, ce n'est pas bloquant!
*/
*/
//'entity_manager_name' => 'doctrine.entitymanager.orm_default',
'UnicaenAuth\Provider\Role\DbRole'
=>
[],
];
/**
* Fournit le rôle correspondant à l'identifiant de connexion de l'utilisateur.
* Cela est utile lorsque l'on veut gérer les habilitations d'un utilisateur unique
* sur des ressources.
*/
'UnicaenAuth\Provider\Role\Username'
=>
[],
],
'resource_providers'
=>
[
/**
/**
* You do not need to edit below this line
* Le service Privilèges peut aussi être une source de ressources,
* si on souhaite tester directement l'accès à un privilège
*/
*/
return
[
'UnicaenAuth\Service\Privilege'
=>
[],
'unicaen-auth'
=>
$settings
,
],
'guards'
=>
[
'UnicaenAuth\Guard\PrivilegeController'
=>
[
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'index'
],
'privileges'
=>
[
Privileges
::
DROIT_ROLE_VISUALISATION
,
Privileges
::
DROIT_PRIVILEGE_VISUALISATION
,
],
],
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'roles'
],
'privileges'
=>
[
Privileges
::
DROIT_ROLE_VISUALISATION
],
],
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'privileges'
],
'privileges'
=>
[
Privileges
::
DROIT_PRIVILEGE_VISUALISATION
],
],
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'role-edition'
,
'role-suppression'
],
'privileges'
=>
[
Privileges
::
DROIT_ROLE_EDITION
],
],
[
'controller'
=>
'UnicaenAuth\Controller\Droits'
,
'action'
=>
[
'privileges-modifier'
],
'privileges'
=>
[
Privileges
::
DROIT_PRIVILEGE_EDITION
],
],
],
],
],
'zfcuser'
=>
[
'zfcuser'
=>
[
'enable_registration'
=>
isset
(
$settings
[
'enable_registration'
])
?
$settings
[
'enable_registration'
]
:
false
,
$k
=
'enable_registration'
=>
isset
(
$settings
[
$k
])
?
$settings
[
$k
]
:
false
,
],
'navigation'
=>
[
// The DefaultNavigationFactory we configured uses 'default' as the sitemap key
'default'
=>
[
// And finally, here is where we define our page hierarchy
'home'
=>
[
'pages'
=>
[
'droits'
=>
[
'label'
=>
'Droits d\'accès'
,
'title'
=>
'Gestion des droits d\'accès'
,
'route'
=>
'droits'
,
'resource'
=>
\UnicaenAuth\Guard\PrivilegeController
::
getResourceId
(
'UnicaenAuth\Controller\Droits'
,
'index'
),
'pages'
=>
[
'roles'
=>
[
'label'
=>
"Rôles"
,
'title'
=>
"Gestion des rôles"
,
'route'
=>
'droits/roles'
,
'resource'
=>
\UnicaenAuth\Guard\PrivilegeController
::
getResourceId
(
'UnicaenAuth\Controller\Droits'
,
'roles'
),
'withtarget'
=>
true
,
],
'privileges'
=>
[
'label'
=>
"Privilèges"
,
'title'
=>
"Gestion des privilèges"
,
'route'
=>
'droits/privileges'
,
'resource'
=>
\UnicaenAuth\Guard\PrivilegeController
::
getResourceId
(
'UnicaenAuth\Controller\Droits'
,
'privileges'
),
'withtarget'
=>
true
,
],
],
],
],
],
],
],
],
];
];
\ No newline at end of file
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