private void UpdateCatalog(webModel.Catalog catalog)
        {
            var moduleCatalog = catalog.ToModuleModel();

            CheckCurrentUserHasPermissionForObjects(CatalogPredefinedPermissions.Update, catalog);

            _catalogService.Update(new[] { moduleCatalog });
        }
        public IHttpActionResult Create(webModel.Catalog catalog)
        {
            var newCatalog = _catalogService.Create(catalog.ToModuleModel());
            var retVal     = newCatalog.ToWebModel();

            //Need for UI permission checks
            retVal.SecurityScopes = GetObjectPermissionScopeStrings(newCatalog);
            return(Ok(retVal));
        }
 public IHttpActionResult Create(webModel.Catalog catalog)
 {
     if ((_permissionService.UserHasAnyPermission(RequestContext.Principal.Identity.Name, PredefinedPermissions.CatalogsManage) && !catalog.Virtual) ||
         (_permissionService.UserHasAnyPermission(RequestContext.Principal.Identity.Name, PredefinedPermissions.VirtualCatalogsManage) && catalog.Virtual))
     {
         var retVal = _catalogService.Create(catalog.ToModuleModel());
         return(Ok(retVal.ToWebModel()));
     }
     else
     {
         throw new UnauthorizedAccessException();
     }
 }
        private void UpdateCatalog(webModel.Catalog catalog)
        {
            var moduleCatalog = catalog.ToModuleModel();

            _catalogService.Update(new moduleModel.Catalog[] { moduleCatalog });
        }