Extract authorization policy for viewing statuses (#3150)
This commit is contained in:
		
					parent
					
						
							
								9a81be0d37
							
						
					
				
			
			
				commit
				
					
						3a2003ba86
					
				
			
		
					 16 changed files with 155 additions and 80 deletions
				
			
		|  | @ -1,6 +1,8 @@ | |||
| # frozen_string_literal: true | ||||
| 
 | ||||
| class Api::Activitypub::ActivitiesController < ApiController | ||||
|   include Authorization | ||||
| 
 | ||||
|   # before_action :set_follow, only: [:show_follow] | ||||
|   before_action :set_status, only: [:show_status] | ||||
| 
 | ||||
|  | @ -8,7 +10,7 @@ class Api::Activitypub::ActivitiesController < ApiController | |||
| 
 | ||||
|   # Show a status in AS2 format, as either an Announce (reblog) or a Create (post) activity. | ||||
|   def show_status | ||||
|     return forbidden unless @status.permitted? | ||||
|     authorize @status, :show? | ||||
| 
 | ||||
|     if @status.reblog? | ||||
|       render :show_status_announce | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue