示例#1
0
        /// <inheritdoc/>
        public Task DeleteWorkshop(long id)
        {
            Workshop workshop = _repository.GetWorkshop(id);

            if (workshop == null)
            {
                throw new NotFoundException();
            }
            else if (workshop.CreatedBy != _userInfo.UserId && !_userInfo.IsAdmin)
            {
                throw new ResourceIsForbiddenException();
            }

            return(_repository.DeleteWorkshop(id));
        }