Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Security API > Methods

Security API: isAdmin

Scroll Prev Next More

 

Returns true if user is an admin (has access to the Admin Area in dynamic permissions), returns false otherwise.

Syntax

Security::isAdmin()

Arguments

No arguments.

Return value

Returns true if user is an admin, returns false otherwise.

Example

This example shows how to check if the current user is an admin.

 

if (Security::isAdmin()) {
  echo "I'm an admin";
}

See also:

Security API: isGuest

Security API: isLoggedIn

User group permissions

Example: Hide controls on Add/Edit pages, based on the username

About Security API

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software