Now check permissions for "upload files".
This commit is contained in:
@@ -207,9 +207,12 @@ feature -- Handler
|
|||||||
r: CMS_RESPONSE
|
r: CMS_RESPONSE
|
||||||
do
|
do
|
||||||
if req.is_get_head_request_method or req.is_post_request_method then
|
if req.is_get_head_request_method or req.is_post_request_method then
|
||||||
-- create body
|
|
||||||
create body.make_empty
|
create body.make_empty
|
||||||
body.append ("<h1> Upload files </h1>%N")
|
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>")
|
body.append ("<p>Please choose some file(s) to upload.</p>")
|
||||||
|
|
||||||
-- create form to choose files and upload them
|
-- create form to choose files and upload them
|
||||||
@@ -221,9 +224,12 @@ feature -- Handler
|
|||||||
if req.is_post_request_method then
|
if req.is_post_request_method then
|
||||||
process_uploaded_files (req, api, body)
|
process_uploaded_files (req, api, body)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
create {FORBIDDEN_ERROR_CMS_RESPONSE} r.make (req, res, api)
|
||||||
|
end
|
||||||
|
|
||||||
-- Build the response.
|
-- Build the response.
|
||||||
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
|
|
||||||
append_uploaded_file_album_to (req, api, body)
|
append_uploaded_file_album_to (req, api, body)
|
||||||
r.set_main_content (body)
|
r.set_main_content (body)
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user