Added delete option as a tab only if the current user has permissions to delete the

current resource
This commit is contained in:
jvelilla
2015-05-13 15:17:19 -03:00
parent 988f32c6c4
commit 57bf5ad0dc
4 changed files with 57 additions and 7 deletions

View File

@@ -89,6 +89,10 @@ feature -- HTTP Methods
check valid_url: req.path_info.starts_with_general ("/node/") end
create edit_response.make (req, res, api, node_api)
edit_response.execute
elseif req.path_info.ends_with_general ("/delete") then
check valid_url: req.path_info.starts_with_general ("/node/") end
create edit_response.make (req, res, api, node_api)
edit_response.execute
else
-- Display existing node
l_nid := node_id_path_parameter (req)
@@ -116,14 +120,14 @@ feature -- HTTP Methods
do
fixme ("Refactor code: extract methods: edit_node and add_node")
if req.path_info.ends_with_general ("/edit") then
create edit_response.make (req, res, api, node_api)
edit_response.execute
elseif req.path_info.ends_with_general ("/delete") then
if
attached {WSF_STRING} req.form_parameter ("op") as l_op and then
l_op.value.same_string ("Delete")
then
do_delete (req, res)
else
create edit_response.make (req, res, api, node_api)
edit_response.execute
end
elseif req.path_info.starts_with_general ("/node/add/") then
create edit_response.make (req, res, api, node_api)