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
c5bdb212
Commit
c5bdb212
authored
Mar 14, 2019
by
Pavel Shutsin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move out link\unlink ability checks to a policy
We can extend the policy in EE for additional behavior
parent
22f792f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
app/policies/identity_provider_policy.rb
app/policies/identity_provider_policy.rb
+2
-0
ee/app/views/profiles/accounts/_group_saml_unlink_buttons.html.haml
...ws/profiles/accounts/_group_saml_unlink_buttons.html.haml
+6
-2
No files found.
app/policies/identity_provider_policy.rb
View file @
c5bdb212
...
...
@@ -13,3 +13,5 @@ class IdentityProviderPolicy < BasePolicy
rule
{
protected_provider
}.
prevent
(
:unlink
)
end
IdentityProviderPolicy
.
prepend
(
EE
::
IdentityProviderPolicy
)
ee/app/views/profiles/accounts/_group_saml_unlink_buttons.html.haml
View file @
c5bdb212
...
...
@@ -3,5 +3,9 @@
.provider-btn-group
.provider-btn-image
=
_
(
"SAML for %{group_name}"
)
%
{
group_name:
group
.
name
}
=
link_to
unlink_group_saml_providers_path
(
group
),
method: :delete
,
class:
'provider-btn'
do
Disconnect
-
if
unlink_provider_allowed?
(
identity
.
saml_provider
)
=
link_to
unlink_group_saml_providers_path
(
group
),
method: :delete
,
class:
'provider-btn'
do
=
s_
(
'Profiles|Disconnect'
)
-
else
%a
.provider-btn
=
s_
(
'Profiles|Active'
)
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