Skip to content
Snippets Groups Projects

NuGet - Add Push Service

Merged David Fernandez requested to merge 10io-nuget-push-delete-service into master
Compare and Show latest version
1 file
+ 6
6
Compare changes
  • Side-by-side
  • Inline
@@ -36,20 +36,20 @@ def authorized_project_find!(id)
project = find_project(id)
unless project && can?(current_user, :read_project, project)
return unauthorized_project_message
return unauthorized_or! { not_found! }
end
project
end
def unauthorized_project_message
current_user ? not_found! : unauthorized_with_header!
end
def authorize!(action, subject = :global, reason = nil)
return if can?(current_user, action, subject)
current_user ? forbidden!(reason) : unauthorized_with_header!
unauthorized_or! { forbidden!(reason) }
end
def unauthorized_or!
current_user ? yield : unauthorized_with_header!
end
def unauthorized_with_header!
Loading