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
a5085e62
Commit
a5085e62
authored
Sep 15, 2021
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update custom emoji policy
parent
8498210c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
app/policies/custom_emoji_policy.rb
app/policies/custom_emoji_policy.rb
+1
-1
app/policies/group_policy.rb
app/policies/group_policy.rb
+2
-0
spec/policies/custom_emoji_policy_spec.rb
spec/policies/custom_emoji_policy_spec.rb
+10
-0
No files found.
app/policies/custom_emoji_policy.rb
View file @
a5085e62
...
...
@@ -9,7 +9,7 @@ class CustomEmojiPolicy < BasePolicy
enable
:delete_custom_emoji
end
rule
{
author
&
can?
(
:
developer_access
)
}.
policy
do
rule
{
author
&
can?
(
:
create_custom_emoji
)
}.
policy
do
enable
:delete_custom_emoji
end
end
app/policies/group_policy.rb
View file @
a5085e62
...
...
@@ -89,6 +89,7 @@ class GroupPolicy < BasePolicy
rule
{
guest
}.
policy
do
enable
:read_group
enable
:upload_file
enable
:guest_access
end
rule
{
admin
}.
policy
do
...
...
@@ -178,6 +179,7 @@ class GroupPolicy < BasePolicy
enable
:update_default_branch_protection
enable
:create_deploy_token
enable
:destroy_deploy_token
enable
:owner_access
end
rule
{
can?
(
:read_nested_project_resources
)
}.
policy
do
...
...
spec/policies/custom_emoji_policy_spec.rb
View file @
a5085e62
...
...
@@ -58,6 +58,16 @@ RSpec.describe CustomEmojiPolicy do
expect_allowed
(
*
custom_emoji_permissions
)
end
end
context
'is emoji creator but not a member of the group'
do
before
do
custom_emoji
.
update_attribute
(
:creator
,
user
)
end
it
do
expect_disallowed
(
*
custom_emoji_permissions
)
end
end
end
end
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