$user


User Methods

$user->isSuperuser()

Introduced in Version 2.0

Description

Is this the Superuser? Returns true or false.

Because this is a boolean (true/false) we can create simple if statements to determine the current user's superuser status:

if ($user->isSuperuser()) {
    // Show some content specifically for superusers - perhaps a link to the ProcessWire admin page
} else {
    // Show different content for all other users
}

Related

Post Comment