<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Video_Plugin_Menus
{
  public function canCreateVideos()
  {
    $viewer = Engine_Api::_()->user()->getViewer();

    if( !Engine_Api::_()->authorization()->isAllowed('video', $viewer, 'create') ) {
      return false;
    }

    return true;
  }
  
  public function onMenuInitialize_VideoMainManage($row)
  {
    $viewer = Engine_Api::_()->user()->getViewer();
    if( !$viewer->getIdentity() ) {
      return false;
    }

    return true;
  }

  public function onMenuInitialize_VideoMainCreate($row)
  {
    $viewer = Engine_Api::_()->user()->getViewer();

    if( !Engine_Api::_()->authorization()->isAllowed('video', $viewer, 'create') ) {
      return false;
    }

    return true;
  }
}
