What does "current.user.nil()" mean here?

jamesgo
Giga Contributor

In this wiki topic: http://wiki.servicenow.com/index.php?title=Creating_New_Homepages it talks about updating "Edit Homepage" UI action with condition:


gs.hasRole('admin') && current.user.nil()


What does "current.user.nil()" mean here?
2 REPLIES 2

CapaJC
ServiceNow Employee
ServiceNow Employee

Means the "user" field has no value.


geoffcox
Giga Guru

I believe this is meant to prevent the UI Action from appearing if the page is some individual's personalized homepage. Thus, only global homepages will have the button.

Personalized homepages probably have a reference to the owner in the "current.user" field, so "current.user.nil()" tests to make sure it doesn't have a value.