Browse files

Allow private pastes to be viewable by anyone via the API as long as …

…they have the URL.
  • Loading branch information...
1 parent 8795dc5 commit c1c09e3f39a3689bb8087e70778205362a27d2bf @Raynes Raynes committed Jan 5, 2012
Showing with 2 additions and 7 deletions.
  1. +2 −7 src/refheap/views/api.clj
@@ -76,12 +76,7 @@
:else (api/response :no-content (paste/delete-paste id))))
(api/response :not-found "Paste doesn't exist.")))
-(defpage "/api/paste/:id" {:keys [id username token]}
+(defpage "/api/paste/:id" {:keys [id]}
(if-let [paste (paste/get-paste id)]
- (let [user (api/validate-user username token)]
- (cond
- (string? user) (api/response :unprocessable user)
- (and (:private paste) (not= (:id user) (:user paste)))
- (api/response :unprocessable "You can't see private pastes that you don't own.")
- :else (api/response :ok (api/process-paste paste))))
+ (api/response :ok (api/process-paste paste))
(api/response :not-found "Paste does not exist.")))

0 comments on commit c1c09e3

Please sign in to comment.