1 # frozen_string_literal: true
4 include CanCan::Ability
7 can :read, [:feature_query, :layers_pane, :legend_pane, :share_pane]
8 can :read, [Node, Way, Relation, OldNode, OldWay, OldRelation]
9 can :read, [RelationMember, OldRelationMember]
10 can [:show, :create], Note
11 can :read, :directions
12 can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :communities, :preview, :copyright, :id], :site
13 can [:finish, :embed], :export
14 can [:create, :read], :search
16 if Settings.status != "database_offline"
17 can [:read, :feed], Changeset
18 can :read, ChangesetComment
19 can [:confirm, :confirm_resend, :confirm_email], :confirmation
20 can [:read, :rss], DiaryEntry
21 can :read, DiaryComment
23 can [:create, :update], :password
25 can [:create, :destroy], :session
26 can [:read, :data], Trace
27 can [:read, :create, :suspended, :auth_success, :auth_failure], User
33 can :read, [:deletion, :account_terms, :account_pd_declaration, :account_home]
35 if Settings.status != "database_offline"
36 can [:read, :create, :destroy], ChangesetSubscription
37 can [:read, :create, :update, :destroy], :oauth2_application
38 can [:read, :destroy], :oauth2_authorized_application
39 can [:read, :create, :destroy], :oauth2_authorization
40 can [:read, :update, :destroy], :account
41 can :update, :account_terms
42 can :create, :account_pd_declaration
44 can [:read, :update], [:preferences, :profile]
45 can [:create, :subscribe, :unsubscribe], DiaryEntry
46 can :update, DiaryEntry, :user => user
47 can [:create], DiaryComment
48 can [:show, :create, :destroy], Follow
49 can [:read, :create, :destroy], Message
50 can [:close, :reopen], Note
52 can [:mine, :create, :update, :destroy], Trace
53 can [:account, :go_public], User
54 can [:read, :create, :destroy], UserMute
57 can [:hide, :unhide], [DiaryEntry, DiaryComment]
58 can [:read, :resolve, :ignore, :reopen], Issue
59 can :create, IssueComment
60 can [:create, :update, :destroy], Redaction
61 can [:create, :destroy], UserBlock
62 can :update, UserBlock, :creator => user
63 can :update, UserBlock, :revoker => user
64 can :update, UserBlock, :active? => true
67 if user.administrator?
68 can [:hide, :unhide], [DiaryEntry, DiaryComment]
69 can [:read, :resolve, :ignore, :reopen], Issue
70 can :create, IssueComment
72 can [:update], :user_status
73 can [:read, :update], :users_list
74 can [:create, :destroy], UserRole
79 # Define abilities for the passed in user here. For example:
81 # user ||= User.new # guest user (not logged in)
88 # The first argument to `can` is the action you are giving the user
90 # If you pass :manage it will apply to every action. Other common actions
91 # here are :read, :create, :update and :destroy.
93 # The second argument is the resource the user can perform the action on.
94 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
95 # class of the resource.
97 # The third argument is an optional hash of conditions to further filter the
99 # For example, here the user can only update published articles.
101 # can :update, Article, :published => true
103 # See the wiki for details:
104 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities