You are here

public function StateFlow_Event::validate in State Machine 7.3

Same name and namespace in other branches
  1. 6 modules/state_flow/plugins/state_flow.inc \StateFlow_Event::validate()
  2. 7 modules/state_flow/plugins/state_flow.inc \StateFlow_Event::validate()
  3. 7.2 modules/state_flow/plugins/state_flow.inc \StateFlow_Event::validate()

Validate that the given event can take place.

Overrides StateMachine_Event::validate

File

modules/state_flow_entity/plugins/state_flow_entity.inc, line 1025
State Flow implementation of the State Machine class.

Class

StateFlow_Event
@todo, should this class be renamed to StateFlow_Event?

Code

public function validate() {
  if (parent::validate()) {
    if (!empty($this->options['permissions'])) {
      foreach ($this->options['permissions'] as $permission) {
        if (!user_access($permission)) {
          return FALSE;
        }
      }
    }
    return TRUE;
  }
  return FALSE;
}