Search code examples
abp-framework

Temporarily grant permissions in ABP framework


I have a site running the ABP.io framework where I would like to let visitors register themselves as new tenants. The problem is that creating a tenant with ITenantAppService requires permissions that anonymous users do not have.

Is there any way to temporarily execute code that require elevated permissions without logging in?


Solution

  • temporary disabling permissions is not a good practice. you need to create a new AppService for this purpose: IPublicTenantAppService and there shouldn't be permission on this service. If you have specific business logic create a new domain service and call that service in the PublicTenantAppService