Read-Only Mode

You can activate read-only mode. This allows browsing and querying data, but not deleting/adding/editing.

<?php 

$app->setReadOnly (true);
?>

Using read-only along with auth

You can use read only mode in conjunction with Basic Login Page like this:

<?php
$login = new BasicLoginPage ();
$login->setWelcomeMessage ("Use credentials admin/demo or user/demo"); // Change this as you want
if ($login->userTriedLogin ()) {
	// TODO: verify login
}
$app->useLogin ($login);

// This function returns the logged in user name. You can set it to be read-only for this user
if ($login->getLoggedInUser () === "user") {
    // If the user isn't `admin` then use read-only 
    $app->setReadOnly (true);
}
?>

Built by Anirudh Sanjeev. CrudKit is distributed under the MIT/X11 License.