]> git.openstreetmap.org Git - rails.git/blobdiff - app/abilities/ability.rb
Merge pull request #5437 from AntonKhorev/user-status-resource
[rails.git] / app / abilities / ability.rb
index 9516a30126ce8f05211fe593386dfe17bd521ba7..e31e3e930cc8ed60368b85c94fc73318756491a7 100644 (file)
@@ -24,13 +24,12 @@ class Ability
       can [:create, :destroy], :session
       can [:read, :data, :georss], Trace
       can [:read, :create, :suspended, :auth_success, :auth_failure], User
       can [:create, :destroy], :session
       can [:read, :data, :georss], Trace
       can [:read, :create, :suspended, :auth_success, :auth_failure], User
-      can [:read, :update], :account_terms
       can :read, UserBlock
     end
 
     if user&.active?
       can :welcome, :site
       can :read, UserBlock
     end
 
     if user&.active?
       can :welcome, :site
-      can :read, :deletion
+      can :read, [:deletion, :account_terms]
 
       if Settings.status != "database_offline"
         can [:subscribe, :unsubscribe], Changeset
 
       if Settings.status != "database_offline"
         can [:subscribe, :unsubscribe], Changeset
@@ -38,11 +37,12 @@ class Ability
         can [:read, :destroy], :oauth2_authorized_application
         can [:read, :create, :destroy], :oauth2_authorization
         can [:update, :destroy], :account
         can [:read, :destroy], :oauth2_authorized_application
         can [:read, :create, :destroy], :oauth2_authorization
         can [:update, :destroy], :account
+        can :update, :account_terms
         can :read, :dashboard
         can [:create, :subscribe, :unsubscribe], DiaryEntry
         can :update, DiaryEntry, :user => user
         can [:create], DiaryComment
         can :read, :dashboard
         can [:create, :subscribe, :unsubscribe], DiaryEntry
         can :update, DiaryEntry, :user => user
         can [:create], DiaryComment
-        can [:make_friend, :remove_friend], Friendship
+        can [:show, :create, :destroy], Follow
         can [:read, :create, :mark, :unmute, :destroy], Message
         can [:close, :reopen], Note
         can [:read, :update], :preference
         can [:read, :create, :mark, :unmute, :destroy], Message
         can [:close, :reopen], Note
         can [:read, :update], :preference
@@ -67,7 +67,8 @@ class Ability
           can [:hide, :unhide], [DiaryEntry, DiaryComment]
           can [:read, :resolve, :ignore, :reopen], Issue
           can :create, IssueComment
           can [:hide, :unhide], [DiaryEntry, DiaryComment]
           can [:read, :resolve, :ignore, :reopen], Issue
           can :create, IssueComment
-          can [:set_status, :destroy], User
+
+          can [:update], :user_status
           can [:read, :update], :users_list
           can [:create, :destroy], UserRole
         end
           can [:read, :update], :users_list
           can [:create, :destroy], UserRole
         end