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
37723dc6
Commit
37723dc6
authored
Feb 20, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI and controller for group members access reset
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
93874928
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
0 deletions
+42
-0
app/controllers/groups/ldaps_controller.rb
app/controllers/groups/ldaps_controller.rb
+22
-0
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+4
-0
app/models/group.rb
app/models/group.rb
+4
-0
app/views/groups/members.html.haml
app/views/groups/members.html.haml
+4
-0
config/routes.rb
config/routes.rb
+8
-0
No files found.
app/controllers/groups/ldaps_controller.rb
0 → 100644
View file @
37723dc6
class
Groups::LdapsController
<
ApplicationController
before_filter
:group
before_filter
:authorize_admin_group!
def
reset_access
LdapGroupResetService
.
new
.
execute
(
group
,
current_user
)
redirect_to
members_group_path
(
@group
),
notice:
'Access reset complete'
end
private
def
group
@group
||=
Group
.
find_by
(
path:
params
[
:group_id
])
end
def
authorize_admin_group!
unless
can?
(
current_user
,
:manage_group
,
group
)
return
render_404
end
end
end
app/helpers/application_helper.rb
View file @
37723dc6
...
@@ -233,4 +233,8 @@ module ApplicationHelper
...
@@ -233,4 +233,8 @@ module ApplicationHelper
content_tag
(
:i
,
nil
,
class:
'icon-spinner icon-spin'
)
+
text
content_tag
(
:i
,
nil
,
class:
'icon-spinner icon-spin'
)
+
text
end
end
end
end
def
ldap_enabled?
Gitlab
.
config
.
ldap
.
enabled
end
end
end
app/models/group.rb
View file @
37723dc6
...
@@ -76,4 +76,8 @@ class Group < Namespace
...
@@ -76,4 +76,8 @@ class Group < Namespace
self
.
errors
.
add
:avatar
,
"only images allowed"
self
.
errors
.
add
:avatar
,
"only images allowed"
end
end
end
end
def
human_ldap_access
Gitlab
::
Access
.
options_with_owner
.
key
ldap_access
end
end
end
app/views/groups/members.html.haml
View file @
37723dc6
...
@@ -15,6 +15,10 @@
...
@@ -15,6 +15,10 @@
-
if
current_user
.
can?
:manage_group
,
@group
-
if
current_user
.
can?
:manage_group
,
@group
.pull-right
.pull-right
-
if
ldap_enabled?
&&
@group
.
ldap_cn
.
present?
=
link_to
reset_access_group_ldap_path
(
@group
),
class:
'btn grouped'
,
data:
{
confirm:
"Reset all ldap group members access to '
#{
@group
.
human_ldap_access
}
'?"
},
method: :put
do
Reset access
=
link_to
'#'
,
class:
'btn btn-new js-toggle-visibility-link'
do
=
link_to
'#'
,
class:
'btn btn-new js-toggle-visibility-link'
do
Add members
Add members
%i
.icon-chevron-down
%i
.icon-chevron-down
...
...
config/routes.rb
View file @
37723dc6
...
@@ -159,6 +159,14 @@ Gitlab::Application.routes.draw do
...
@@ -159,6 +159,14 @@ Gitlab::Application.routes.draw do
get
:members
get
:members
end
end
scope
module: :groups
do
resource
:ldap
,
only:
[]
do
member
do
put
:reset_access
end
end
end
resources
:users_groups
,
only:
[
:create
,
:update
,
:destroy
]
resources
:users_groups
,
only:
[
:create
,
:update
,
:destroy
]
scope
module: :groups
do
scope
module: :groups
do
resource
:avatar
,
only:
[
:destroy
]
resource
:avatar
,
only:
[
:destroy
]
...
...
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