Mixin_WordPress_Security_Actor

The NextGEN Gallery Mixin WordPress Security Actor class.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/security/package.module.security.php  
  1. class Mixin_WordPress_Security_Actor extends Mixin 
  2. public function add_capability($capability_name) 
  3. $entity = $this->object->get_entity(); 
  4. if ($entity != null) { 
  5. $capability_name = $this->object->get_native_action($capability_name); 
  6. $entity->add_cap($capability_name); 
  7. return true; 
  8. return false; 
  9. public function remove_capability($capability_name) 
  10. $entity = $this->object->get_entity(); 
  11. if ($entity != null && $this->object->is_allowed($capability_name)) { 
  12. $capability_name = $this->object->get_native_action($capability_name); 
  13. $entity->remove_cap($capability_name); 
  14. return true; 
  15. return false; 
  16. public function is_allowed($capability_name, $args = null) 
  17. $entity = $this->object->get_entity(); 
  18. if ($entity != null) { 
  19. $capability_name = $this->object->get_native_action($capability_name, $args); 
  20. return $entity->has_cap($capability_name); 
  21. return false; 
  22. public function is_user() 
  23. return $this->object->get_entity_type() == 'user'; 
  24. public function get_native_action($capability_name, $args = null) 
  25. return $capability_name;