Base solution for your next web application

Activities of "nnlee"

Answer

<cite>NNLEE: </cite> All right .Is there a last version demo .Thank you.

That means some another project with new version Abp or another way to learn about this topic.

Answer

All right .Is there a last version demo .Thank you.

Question
using Abp.Modules;
using Abp.WebApi.Controllers.Dynamic.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestModule
{
    public class Test : AbpModule
    {
        public override void Initialize(Abp.Startup.IAbpInitializationContext initializationContext)
        {
            base.Initialize(initializationContext);

            initializationContext.IocContainer.Install(new WebApiInstaller());

            
        }

        private static void CreateWebApiProxiesForServices()
        {
            DynamicApiControllerBuilder
                .For<ITaskeverUserAppService>("taskever/user")
                .Build();
        }
    }
}

Like this , when I reference Abp.Modules and reference Abp.Web.Api at the same time ,they seems conflict .The class of 'Abp.Startup.IAbpInitializationContext' cant be finded out.Please tell me how to use these two class in one project ,thank you

<cite>hikalkan: </cite> Hi,

You are using Configuration.Authorization.Providers.Add<Permission>(); in the Permission class. It's not true. It should be done in PreInitialize method of your module (<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Module-System#DocModulePreInit">http://www.aspnetboilerplate.com/Pages/ ... ulePreInit</a>). Also, "Permission" name is not good, I suggest to change it to MyPermissionProvider or something like that.

Thank a lot ,I just read the module topic ,suddenly figured out ,thanks again patiently answered :D

<cite>hikalkan: </cite> Can you share whole code? Have you defined auth provider? Which version of ABP are you using?

Version 0.6.2 . And I has upadate it ver 0.6.4 ,but always cant find it. Please help me check it ,thank you very muck

using Abp;
using Abp.Authorization;
namespace Foundation.Application
{
    public class Permission : AuthorizationProvider
    {
        public override void SetPermissions(IPermissionDefinitionContext context)
        {
            var administrator = context.CreatePermission("Administrator", null);

            var userManagement = administrator.CreateChildPermission("Administrator.UserManagement");

            userManagement.CreateChildPermission("Administrator.UserManagement.CreateUser");

            var roleManagement = administrator.CreateChildPermission("Administrator.RoleManagement");

            Configuration.Authorization.Providers.Add<Permission>();
          
            
        }
    }
}

Like title .I'm looking at the document about Authoration. I try to code like the document, but when I coding this "Configuration.Authorization.Providers.Add<MyAuthorizationProvider>();" I cant find how to use this configuration,I cant fine the namespace.Please help me .Thank you

Showing 1 to 6 of 6 entries