When using the Restrict Access feature to hide and/or display course activities based on values contained in custom user profile fields, the student must log off and back on before the restriction rules take effect.
Also see this tracker item for the same issue addressed in version 2.4: https://tracker.moodle.org/browse/MDL-34286
Steps to test:
1) Set "Enable Restricted Access" to YES in Advanced Features
2) Created a User Profile Field with a "checkbox" format and a setting of "Locked"=YES
3) Added a basic URL activity to a course
4) Added a restriction making the activity available only if the profile field from step 2 does not contain a "1"
5) Logged in as student in a separate browser to to make sure the activity is available (it was)
6) As administrator, set the profile field for the student user to "checked", which should make the activity "unavailable".
7) As student, refreshed the browser and saw that the activity is still available, even after several minutes.
8) Logged out and back in as student and the activity is now unavailable.