Session userSession = slingRequest.getResourceResolver().adaptTo(Session.class);
String userId = userSession.getUserID();
You can do many othre things like getting userManager , authorizable etc once you have the session.
You can set a flag in JS and based on that flag write visibility expression on that field