Show/Hide Toolbars

Navigation: Advanced topics > Programming topics > Security API

PHPrunner32x32     PHPRunner manual


About Security API

Scroll Prev Next More

 

Security API allows you to work with permission level in your application.
Permissions need to be set only once per user session, i.e. in the After Successful Login event.
 

Functions

Function

Description

getUserGroup()

Returns current user group name. Makes more sense to use with static permissions where each user belongs to single user group.

getUserGroups()

Returns an array with all user groups

getUserName()

Returns current Username

getDisplayName()

Returns current Display Name

setDisplayName()

Set current Display Name

isGuest()

Returns true if user logged in as Guest, returns false otherwise

isAdmin()

Returns true if user is an admin, returns false otherwise

isLoggedIn()

Returns true if user is logged in, returns false otherwise

loginAs()

Logs user in, no redirects

logout()

Just logout, no redirects.

getOwnerId()

setOwnerId()

These functions get or set OwnerID for specific table when Advanced Security like 'Users can see and edit their own data' is in use.

checkUsernamePassword()

This function checks username and password and returns true if username/password are correct, returns false otherwise.

getUserData()

Returns array with user data from login table. Returns false if user not found.

currentUserData()

Returns array with current user data from login table.

getPermissions()

setPermissions()

Gets/sets permissions for certain table