- if user.moderator?
- can [:destroy, :restore], ChangesetComment
- can [:index, :show, :resolve, :ignore, :reopen], Issue
- can :create, IssueComment
- can [:new, :create, :edit, :update, :destroy], Redaction
- can [:new, :edit, :create, :update, :revoke], UserBlock
- end
+ if Settings.status != "database_offline"
+ can [:read, :create, :destroy], :changeset_subscription
+ can [:read, :create, :update, :destroy], :oauth2_application
+ can [:read, :destroy], :oauth2_authorized_application
+ can [:read, :create, :destroy], :oauth2_authorization
+ can [:read, :update, :destroy], :account
+ can :update, :account_terms
+ can :create, :account_pd_declaration
+ can :read, :dashboard
+ can [:create, :subscribe, :unsubscribe], DiaryEntry
+ can :update, DiaryEntry, :user => user
+ can [:create], DiaryComment
+ can [:show, :create, :destroy], Follow
+ can [:read, :create, :destroy], Message
+ can [:close, :reopen], Note
+ can [:read, :update], :preference
+ can :update, :profile
+ can :create, Report
+ can [:mine, :create, :update, :destroy], Trace
+ can [:account, :go_public], User
+ can [:read, :create, :destroy], UserMute
+
+ if user.moderator?
+ can [:hide, :unhide], [DiaryEntry, DiaryComment]
+ can [:read, :resolve, :ignore, :reopen], Issue
+ can :create, IssueComment
+ can [:create, :update, :destroy], Redaction
+ can [:create, :destroy], UserBlock
+ can :update, UserBlock, :creator => user
+ can :update, UserBlock, :revoker => user
+ can :update, UserBlock, :active? => true
+ end
+
+ if user.administrator?
+ can [:hide, :unhide], [DiaryEntry, DiaryComment]
+ can [:read, :resolve, :ignore, :reopen], Issue
+ can :create, IssueComment