7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'app/permissions/decidim/proposals/admin/permissions.rb', line 7
def permissions
return permission_action if permission_action.scope != :admin
if create_permission_action?
allow! if permission_action.subject == :proposal_note
toggle_allow(admin_creation_is_enabled?) if permission_action.subject == :proposal
toggle_allow(admin_proposal_answering_is_enabled?) if permission_action.subject == :proposal_answer
end
allow! if permission_action.subject == :proposal && permission_action.action == :edit && admin_edition_is_available?
allow! if permission_action.subject == :proposal_category && permission_action.action == :update
allow! if permission_action.subject == :proposals && permission_action.action == :import
allow! if permission_action.subject == :proposals && permission_action.action == :merge
allow! if permission_action.subject == :proposals && permission_action.action == :split
if permission_action.subject == :participatory_texts && participatory_texts_are_enabled?
allow! if permission_action.action == :manage
end
permission_action
end
|