Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
M
maintenanceMode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SondagesPro
coreAndTools
maintenanceMode
Commits
d9098119
Commit
d9098119
authored
May 29, 2018
by
Chenu Denis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[feature] Allow admin user with only settings update access to disable maintenance
parent
62289638
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
maintenanceMode.php
maintenanceMode.php
+8
-4
No files found.
maintenanceMode.php
View file @
d9098119
...
...
@@ -6,7 +6,7 @@
* @copyright 2017-2018 Denis Chenu <http://www.sondages.pro>
* @license AGPL v3
* @version 1.
0.1
* @version 1.
1.0
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
...
...
@@ -316,16 +316,20 @@ class maintenanceMode extends PluginBase {
if
(
Permission
::
model
()
->
hasGlobalPermission
(
"superadmin"
)
&&
(
$this
->
event
->
get
(
'controller'
)
==
'admin'
||
$this
->
event
->
get
(
'controller'
)
==
'plugins'
))
{
return
true
;
}
/* Allow pluginmanager access for user with settings update */
if
(
Permission
::
model
()
->
hasGlobalPermission
(
"settings"
,
'update'
)
&&
$this
->
event
->
get
(
'controller'
)
==
'admin'
&&
$this
->
event
->
get
(
'action'
)
==
'pluginmanager'
)
{
return
true
;
}
/* Always allow admin login */
if
(
!
Yii
::
app
()
->
session
[
'loginID'
]
&&
$this
->
event
->
get
(
'controller'
)
==
'admin'
){
if
(
!
Permission
::
getUserId
()
&&
$this
->
event
->
get
(
'controller'
)
==
'admin'
){
return
true
;
}
/* Allow admin in condition : disablePublicPart is true (and not admin)*/
if
(
Yii
::
app
()
->
session
[
'loginID'
]
&&
$this
->
event
->
get
(
'controller'
)
!=
'admin'
&&
!
$this
->
get
(
'disablePublicPart'
)){
if
(
Permission
::
getUserId
()
&&
$this
->
event
->
get
(
'controller'
)
!=
'admin'
&&
!
$this
->
get
(
'disablePublicPart'
)){
return
true
;
}
/* Allow admin in condition : superAdminOnly is false*/
if
(
Yii
::
app
()
->
session
[
'loginID'
]
&&
$this
->
event
->
get
(
'controller'
)
==
'admin'
&&
!
$this
->
get
(
'superAdminOnly'
)){
if
(
Permission
::
getUserId
()
&&
$this
->
event
->
get
(
'controller'
)
==
'admin'
&&
!
$this
->
get
(
'superAdminOnly'
)){
return
true
;
}
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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