Now check permissions for "upload files".

This commit is contained in:
2016-01-20 14:06:45 +01:00
parent 53181f901d
commit e1d6e79f09

View File

@@ -207,9 +207,12 @@ feature -- Handler
r: CMS_RESPONSE
do
if req.is_get_head_request_method or req.is_post_request_method then
-- create body
create body.make_empty
body.append ("<h1> Upload files </h1>%N")
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
if r.has_permission ("upload files") then
-- create body
body.append ("<p>Please choose some file(s) to upload.</p>")
-- create form to choose files and upload them
@@ -221,9 +224,12 @@ feature -- Handler
if req.is_post_request_method then
process_uploaded_files (req, api, body)
end
else
create {FORBIDDEN_ERROR_CMS_RESPONSE} r.make (req, res, api)
end
-- Build the response.
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
append_uploaded_file_album_to (req, api, body)
r.set_main_content (body)
else