Reading user session information in yang

Hi, I want to read like the name of the user which runs this operation. I want to implement like:
leaf user {
must “current() = $USER” {
error-message “”;
Here, $USER is the run time user who has logged in. I have tried like $(user), user() but none works.
Is there a possible way to implement this in yang model?

The username information of the current session isn’t available to must validation. You may want to look into making use of authorization rules as provided by NACM instead.