Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d32e5f61
Commit
d32e5f61
authored
Apr 09, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove EE-specific uses of `User#is_admin?`
parent
ea64e309
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
5 deletions
+5
-5
app/controllers/projects/service_desk_controller.rb
app/controllers/projects/service_desk_controller.rb
+1
-1
app/helpers/license_helper.rb
app/helpers/license_helper.rb
+1
-1
app/models/ee/protected_branch_access.rb
app/models/ee/protected_branch_access.rb
+1
-1
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+1
-1
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+1
-1
No files found.
app/controllers/projects/service_desk_controller.rb
View file @
d32e5f61
...
...
@@ -24,6 +24,6 @@ class Projects::ServiceDeskController < Projects::ApplicationController
end
def
authorize_admin_instance!
return
render_404
unless
current_user
.
is_
admin?
return
render_404
unless
current_user
.
admin?
end
end
app/helpers/license_helper.rb
View file @
d32e5f61
...
...
@@ -15,7 +15,7 @@ module LicenseHelper
# in_html is set to false from an initializer, which shouldn't try to render
# HTML links.
#
def
license_message
(
signed_in:
signed_in?
,
is_admin:
(
current_user
&&
current_user
.
is_
admin?
),
in_html:
true
)
def
license_message
(
signed_in:
signed_in?
,
is_admin:
(
current_user
&&
current_user
.
admin?
),
in_html:
true
)
@license_message
=
if
License
.
current
yes_license_message
(
signed_in
,
is_admin
)
...
...
app/models/ee/protected_branch_access.rb
View file @
d32e5f61
...
...
@@ -45,7 +45,7 @@ module EE
end
def
check_access
(
user
)
return
true
if
user
.
is_
admin?
return
true
if
user
.
admin?
return
user
.
id
==
self
.
user_id
if
self
.
user
.
present?
return
group
.
users
.
exists?
(
user
.
id
)
if
self
.
group
.
present?
...
...
app/views/projects/edit.html.haml
View file @
d32e5f61
...
...
@@ -135,7 +135,7 @@
.js-service-desk-setting-root
{
data:
{
endpoint:
namespace_project_service_desk_path
(
@project
.
namespace
,
@project
),
enabled:
@project
.
service_desk_enabled
,
incoming_email:
(
@project
.
service_desk_address
if
@project
.
service_desk_enabled
),
is_instance_admin:
current_user
.
is_
admin?
}
}
is_instance_admin:
current_user
.
admin?
}
}
%hr
%fieldset
.features.append-bottom-default
...
...
lib/gitlab/git_access.rb
View file @
d32e5f61
...
...
@@ -143,7 +143,7 @@ module Gitlab
end
if
::
License
.
block_changes?
message
=
::
LicenseHelper
.
license_message
(
signed_in:
true
,
is_admin:
(
user
&&
user
.
is_
admin?
))
message
=
::
LicenseHelper
.
license_message
(
signed_in:
true
,
is_admin:
(
user
&&
user
.
admin?
))
raise
UnauthorizedError
,
strip_tags
(
message
)
end
...
...
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