Site Access control through a particular user field
Let's say there is a specific path you want this rule to apply to, e.g. /special

&lt;?php

function my_module_menu()
{

    $items['special'] = array(
        'title' =&gt; 'Special Page',
        'page callback' =&gt; 'special_page',
        // Permission in next line will be overridden by the check inside the page callback function.
        'access arguments' =&gt; array('access content'),
        'type' =&gt; MENU_SUGGESTED_ITEM,
        );
}

function special_page()
{
    global $user;
    $query = new EntityFieldQuery();
    $query-&gt;entityCondition('entity_type', 'user');
    $query-&gt;propertyCondition('uid', $user-&gt;uid, '=');
    $query-&gt;fieldCondition('field_special_field', 'value', 'required_value', '=');
    $query-&gt;range(0, 1);
    $result = $query-&gt;execute();

    if (isset($result['user'])) {
        // User meets the condition
        // Do whatsoever, show special content ..

    } else {
        // Deny access
        drupal_access_denied();

    }
}

?&gt;


Make sure to download and enable the Entity API module to use the above code.