Example #1
0
/** Sample actions that can be access-controlled through PermissionValidators. */
function createSession($student_id, $user_id)
{
    // This line automatically checks this action against the permissions database before running.
    if (!checkActionPermissionSelf(__FUNCTION__, func_get_args())) {
        return false;
    }
    // Do stuff here
    return true;
}
function loadPresetPermitOptions($fields)
{
    // This block automatically checks this action against the permissions database before running.
    if (!checkActionPermissionSelf(__FUNCTION__, func_get_args())) {
        addAlert("danger", "Sorry, you do not have permission to access this resource.");
        return false;
    }
    return fetchPresetPermitOptions($fields);
}