Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bjy-authorize
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
bjy-authorize
Commits
00ea9ad0
Commit
00ea9ad0
authored
4 months ago
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
6.1.2
----- - Module désactivé en mode Console : config neutralisée & isAllowed renvoie true
parent
19e7cd2e
Branches
ll-sans-console
Branches containing commit
Tags
6.1.2
Tags containing commit
No related merge requests found
Pipeline
#32059
failed
4 months ago
Stage: publish
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
src/BjyAuthorize/Module.php
+12
-0
12 additions, 0 deletions
src/BjyAuthorize/Module.php
src/BjyAuthorize/Service/Authorize.php
+6
-0
6 additions, 0 deletions
src/BjyAuthorize/Service/Authorize.php
with
22 additions
and
0 deletions
CHANGELOG.md
+
4
−
0
View file @
00ea9ad0
CHANGELOG
CHANGELOG
=========
=========
6.
1.2
-----
-
Module désactivé en mode Console : config neutralisée & isAllowed renvoie true
6.
1.1
6.
1.1
-----
-----
-
Retrait de la dépendance à laminas-dependency-plugin
-
Retrait de la dépendance à laminas-dependency-plugin
...
...
This diff is collapsed.
Click to expand it.
src/BjyAuthorize/Module.php
+
12
−
0
View file @
00ea9ad0
...
@@ -24,6 +24,11 @@ class Module implements
...
@@ -24,6 +24,11 @@ class Module implements
*/
*/
public
function
onBootstrap
(
EventInterface
$event
)
public
function
onBootstrap
(
EventInterface
$event
)
{
{
if
(
self
::
inConsole
())
{
// Pas de lancement de BjyAuthorize en mode console
return
;
}
/* @var $app \Laminas\Mvc\ApplicationInterface */
/* @var $app \Laminas\Mvc\ApplicationInterface */
$app
=
$event
->
getTarget
();
$app
=
$event
->
getTarget
();
/* @var $sm \Laminas\ServiceManager\ServiceLocatorInterface */
/* @var $sm \Laminas\ServiceManager\ServiceLocatorInterface */
...
@@ -68,4 +73,11 @@ class Module implements
...
@@ -68,4 +73,11 @@ class Module implements
{
{
return
include
__DIR__
.
'/../../config/module.config.php'
;
return
include
__DIR__
.
'/../../config/module.config.php'
;
}
}
public
static
function
inConsole
():
bool
{
return
PHP_SAPI
==
'cli'
;
}
}
}
This diff is collapsed.
Click to expand it.
src/BjyAuthorize/Service/Authorize.php
+
6
−
0
View file @
00ea9ad0
...
@@ -10,6 +10,7 @@ namespace BjyAuthorize\Service;
...
@@ -10,6 +10,7 @@ namespace BjyAuthorize\Service;
use
BjyAuthorize\Acl\Role
;
use
BjyAuthorize\Acl\Role
;
use
BjyAuthorize\Guard\GuardInterface
;
use
BjyAuthorize\Guard\GuardInterface
;
use
BjyAuthorize\Module
;
use
BjyAuthorize\Provider\Identity\ProviderInterface
as
IdentityProvider
;
use
BjyAuthorize\Provider\Identity\ProviderInterface
as
IdentityProvider
;
use
BjyAuthorize\Provider\Resource\ProviderInterface
as
ResourceProvider
;
use
BjyAuthorize\Provider\Resource\ProviderInterface
as
ResourceProvider
;
use
BjyAuthorize\Provider\Role\ProviderInterface
as
RoleProvider
;
use
BjyAuthorize\Provider\Role\ProviderInterface
as
RoleProvider
;
...
@@ -241,6 +242,11 @@ class Authorize
...
@@ -241,6 +242,11 @@ class Authorize
*/
*/
public
function
isAllowed
(
$resource
,
$privilege
=
null
)
public
function
isAllowed
(
$resource
,
$privilege
=
null
)
{
{
if
(
Module
::
inConsole
()){
// en mode Console tout est permis!
return
true
;
}
$this
->
loaded
&&
$this
->
loaded
->
__invoke
();
$this
->
loaded
&&
$this
->
loaded
->
__invoke
();
try
{
try
{
...
...
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