How to provide limited ability to Delete Project Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 06:51 PM
Hi,
I have 1 clarification & 1 need.
Clarification:
- It appears that according to the Task Delete Record ACL and Delete [Global] UI Action, that users who have project_manager role should be able to delete a Project Task from the form, but as I impersonate such a user I do not see the Delete button. Why?
Need:
- I would like to enable a project_user to delete Project Task, as long as they created it and its state is Pending, so I created the following UI Action
- Name=DELETE
- Table=Project Task
- Action=sysver_delete
- Active=true
- ShowUpdate=true
- Client=true
- FormButton=true
- OnClick=confirmAndDeleteFromForm()
- Condition=current.isValidRecord() && current.canDelete() && gs.getUserID() == current.sys_created_by && current.state == 1
- Script=current.deleteRecord();
- RequiresRole=project_user
- Yet, when I impersonate such a user my DELETE button does not show up on the form for a Pending Project Task which I just created. Why?
My questions are:
- Is the solution to my need correct?
- If so, is it related to the clarification, not working as expected?
Any hint would be appreciated; thanks!
Guislain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 11:35 PM
Looks strange.
Everything is looking good.
Can enable Debug Security Rules and open a project task record.
Then below the rendered form search for text pm_project_task/delete
It should all be Green like shown here in attached picture.
If it is red, then probably you have some customization in ACLs which preventing the Delete action from appearing.
If it is all green and still Delete button is not coming, then check the UI Action Delete on Global if there is some customization which is preventing it from appearing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 11:52 AM
Hi Arun,
OK digging into debugger...
- Turned on Debug Security.
- Impersonate Amelia Caputo
- Took shortcut to PRJTASK0010068 "My Pre-Project Team Kickoff Meeting" assigned to Amelia Caputo
- Search "record/pm_project_task/delete" and get 1 of 9 found
- First refers to OOTB ACL with it_manager_role which Amelia does not have; so far so good , albeit I am suspicious of the condition phrasing
- Second refers to custom ACL with it_project_user role which Amelia does have; so far so good , albeit I am suspicious of the condition phrasing
- But will ignore that for now, since it seems to execute the same rules from cache
- Will ignore 1st since ACL refers to OOTB it_manager_role
- But wonder why 2nd is now , and I am not sure how to interpret the last rule returning RC = false for CONTEXT = pm_project_task.sys_id=null
Having said so, following the UI Action breadcrumb trail, and inactivating my custom UI Action, which I described on my original post,
did solve the problem for both Amelia Caputo with the it_project_user role
until she starts to work on her task,
and Guislain Lagron with the it_manager_role role.
Thank you both Earl & Arun; I feel a bit , but I did a lot of learning on this one!
You help was much appreciated!
Guislain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 12:03 PM
Although there is a lot of point/click configuration/development in ServiceNow, it's not always easy to sort out the right things to click on and how to set things to make sure they work the way we want them to. It is definitely a learning experience. Glad you got it sorted out.
Earl