You are here

function context_condition_user::execute in Context 6.3

Same name and namespace in other branches
  1. 6 plugins/context_condition_user.inc \context_condition_user::execute()
  2. 7.3 plugins/context_condition_user.inc \context_condition_user::execute()

File

plugins/context_condition_user.inc, line 23

Class

context_condition_user
Expose current user role as a context condition.

Code

function execute($account) {
  $roles = $account->roles;
  foreach ($roles as $rid => $role) {
    foreach ($this
      ->get_contexts($role) as $context) {
      $this
        ->condition_met($context, $role);
    }
  }
}