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, 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 output the current user data.

 

$userData = Security::isAdmin();
var_dump($userData);

Sample output

bool(false)
or
bool(true)

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