protected override void ValidateUser()
        {
            var userId = this.Context.GetCurrentUser().Id;

            var valid = RolePermissionCachingService.GetCurrent().CanCreate(this.ModelClassId, Context);

            if (!valid)
            {
                //throw new ForbiddenException("No permission. For model class id : " + this.ModelClassId, ExceptionSeverity.Information);
            }
        }
Example #2
0
        public static void Init()
        {
            //Load all the caching services
            ApplicationCrudHooksCachingService.GetCurrent();
            ApplicationPermissionCachingService.GetCurrent();
            BusinessRulesCachingService.GetCurrent();
            CollectionFilterCachingService.GetCurrent();
            CrudHooksCachingService.GetCurrent();
            CrudRulesCachingService.GetCurrent();
            DataRulesCachingService.GetCurrent();
            ModelClassCachingService.GetCurrent();
            RolePermissionCachingService.GetCurrent();

            //run the old config...soon to be obsolete
            Config.Init();
        }