Now check permissions for "upload files".
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user