Пример #1
0
        public HttpResponseMessage DeleteVideo(VideoInfo video)
        {
            try
            {
                Requires.NotNull("video", video);
                Requires.NotNegative("video.ModuleId", video.ModuleId);
                Requires.NotNegative("video.VideoId", video.VideoId);

                if (UserInfo.IsInRole(PortalSettings.AdministratorRoleName))
                {
                    var vc = new VideoController();

                    //vc.DeleteVideo(video);
                    vc.DeleteVideo(video.VideoId, video.ModuleId);

                    return(Request.CreateResponse(HttpStatusCode.OK));
                }
                else
                {
                    return(Request.CreateResponse(HttpStatusCode.Forbidden));
                }
            }
            catch (Exception exc)
            {
                Exceptions.LogException(exc);
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc));
            }
        }