1
0

BxBaseModGroupsPrivacyNotifications.php 1007 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup BaseGroups Base classes for groups modules
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxBaseModGroupsPrivacyNotifications extends BxBaseModGroupsPrivacy
  12. {
  13. function __construct($aOptions, $oTemplate = false)
  14. {
  15. parent::__construct($aOptions, $oTemplate);
  16. }
  17. function check($iObjectId, $iViewerId = 0)
  18. {
  19. if (!parent::check($iObjectId, $iViewerId))
  20. return false;
  21. if (!($aEvent = BxDolService::call('bx_notifications', 'get_event_by_id', array($iObjectId))))
  22. return false;
  23. return $this->checkGroupMember($aEvent['object_owner_id'], $iViewerId ? $iViewerId : bx_get_logged_profile_id());
  24. }
  25. public function checkGroupMember($iGroupProfileId, $iViewerId)
  26. {
  27. return $this->_oModule->_oDb->isAdmin($iGroupProfileId, $iViewerId);
  28. }
  29. }
  30. /** @} */