Source for file AuthZXmlAction.class.php

Documentation is available at AuthZXmlAction.class.php

  1. <?php
  2. /**
  3. * @since 11/29/06
  4. * @package polyphony.authorization
  5. *
  6. * @copyright Copyright &copy; 2005, Middlebury College
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  8. *
  9. * @version $Id: AuthZXmlAction.class.php,v 1.4 2007/09/19 14:04:53 adamfranco Exp $
  10. */
  11. require_once(POLYPHONY_DIR.'/main/library/AbstractActions/XmlAction.class.php');
  12.  
  13. /**
  14. * This class implements common authorization methods
  15. *
  16. * @since 11/29/06
  17. * @package polyphony.authorization
  18. *
  19. * @copyright Copyright &copy; 2005, Middlebury College
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  21. *
  22. * @version $Id: AuthZXmlAction.class.php,v 1.4 2007/09/19 14:04:53 adamfranco Exp $
  23. */
  24. class AuthZXmlAction
  25. extends XmlAction
  26. {
  27.  
  28. /**
  29. * Execute this action
  30. *
  31. * @return void
  32. * @access public
  33. * @since 11/29/06
  34. */
  35. function execute () {
  36. if (!$this->isAuthorizedToExecute())
  37. $this->getUnauthorizedMessage();
  38. else
  39. $this->buildContent();
  40. }
  41. /**
  42. * Answer the Id of the qualifier
  43. *
  44. * @return object Id
  45. * @access public
  46. * @since 11/29/06
  47. */
  48. function getQualifierId () {
  49. if (!isset($this->_qualifierId)) {
  50. $idManager = Services::getService("Id");
  51. $harmoni = Harmoni::instance();
  52. $harmoni->request->startNamespace("polyphony-authz");
  53. if (!RequestContext::value('qualifier_id'))
  54. $this->error("No Qualifier Id");
  55. $this->_qualifierId = $idManager->getId(
  56. RequestContext::value('qualifier_id'));
  57. $harmoni->request->endNamespace();
  58. }
  59. return $this->_qualifierId;
  60. }
  61. /**
  62. * Answer the Id of the qualifier
  63. *
  64. * @return object Id
  65. * @access public
  66. * @since 11/29/06
  67. */
  68. function getFunctionId () {
  69. if (!isset($this->_functionId)) {
  70. $idManager = Services::getService("Id");
  71. $harmoni = Harmoni::instance();
  72. $harmoni->request->startNamespace("polyphony-authz");
  73. if (!RequestContext::value('function_id'))
  74. $this->error("No Function Id");
  75. $this->_functionId = $idManager->getId(
  76. RequestContext::value('function_id'));
  77. $harmoni->request->endNamespace();
  78. }
  79. return $this->_functionId;
  80. }
  81. /**
  82. * Answer the Id of the agent
  83. *
  84. * @return object Id
  85. * @access public
  86. * @since 11/29/06
  87. */
  88. function getAgentId () {
  89. if (!isset($this->_agentId)) {
  90. $idManager = Services::getService("Id");
  91. $harmoni = Harmoni::instance();
  92. $harmoni->request->startNamespace("polyphony-authz");
  93. if (!RequestContext::value('agent_id'))
  94. $this->error("No Agent Id");
  95. $this->_agentId = $idManager->getId(
  96. RequestContext::value('agent_id'));
  97. $harmoni->request->endNamespace();
  98. }
  99. return $this->_agentId;
  100. }
  101. }
  102.  
  103. ?>

Documentation generated on Wed, 19 Sep 2007 10:21:42 -0400 by phpDocumentor 1.3.0RC3