Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "acmeware"

Question

Hi, I need to create a method to override certain permissions regardless of what is in the table.

In my UserManager.cs I added this hard-code to test out where to do this. It is not working, the user still has permission to this page. Where should I override permissions in this way if not here?

public override async Task<bool> IsGrantedAsync(long userId, Permission permission)
{
    if (permission.Name == "Pages.ConnectionLogs.Create")
    {
        return false;
    }
    return await base.IsGrantedAsync(userId, permission);                     
}

Ill close for now. Thanks for considering an enhancement for this.

Could you provide a hardcoded example inside AccountController.Login POST or wherever you think it should go as to how you would change the current tenant from host to the tenant ID. I have made it as far as getting logged in but there is a warning now and it logs out.

"Current user did not login to the application!"

Hi, I have tried writing to session and also claims to change the tenant.Id but am not having any luck. I assume you just set it directly like this, but that didn't work?

AbpClaimTypes.TenantId = "135";

Can you guide me further as to where this should be done and how? I was expecting it might work by doing so in TryAuthenticateAsync as you stated. If that is the right place please let me know how. We are just getting started and still learning the framework so I apologize if this seems simple.

Hi, I have succesfully implemented the DefaultExternalAuthenticationSource to provide the bool for TryAuthenticateAsync. However I would like to change the tenant based on data that comes back from the external source. How do I override the Tenant in TryAuthenticateAsync (or where do you suggest) so that when the user is checked it sets the correct tenant before checking the database and updating or creating the user.

My plan is to hide the tenancy selection and override the tenant based on the return values from the external source. Where is the best place to override the tenant and what code do I use to override?

I tried a number of things in these question and in github to no avail.

Thanks.

To confirm the rad tool is only intended to work with AspZeroDbContext, not AbpDbContext, correct?

Allow me to back up the story a little. I did follow all of the instructions in that link and things seem to be working fine, but I am only just testing a few entities. The second dbcontext was originally setup as AbpDbContext. I was creating the entities using the RAD tool and manually copying them to second dbcontext from the primary AspZeroDbContext. My entities with TenantID seem to work fine and file the data and retrieve.

Then I saw the enhancement to the rad tool thinking that it now allowed for the AbpDbContext to be used, but it does not. It only seems to allow AspZeroDbContext. As a test I switched my second dbcontext to inherit AspZeroDbContext. My entities with TenantID seem to work just fine even after I delete all the ABP tables. Maybe I was just getting lucky?

In the end, I would like to use the rad tool to build entities in a separate database without all the extra ABP tables. Is that possible? I can probably research overriding the building of ABP tables, but I am worried that I don’t understand the system well enough to know if this will be a problem later. What are your thoughts? Thanks.

How is the new RAD tool multiple dbcontext supposed to be used? I was thinking that it allowed the RAD tool to work against non-inherited dbcontext, but I have to inheret from AbpZeroDbContext in order for the context to be visible in the tool. This then creates all the ABP tables in the secondary database.

As a side question, is it even possible to have a second database keeping all the ABP tables in the default context without the use of a separate module? I have some sensitive data I'd like to store in a separate database but not have to duplicate the entire original database.

I'm authenticating users against an external endpoint which also has a tenancy setup. I want to register the user to a tenant with the same ID number as the other system. Is it possible to register a tenant with the a specific ID if it does not exist already? I don't see a way to push down to the repository a tenant id.

thanks

Hi, is there a way to configure the ASP.NET Zero RAD Tool so that it works outside of the ASP.NET Zero solution?

I want to create a separate ASP.NET Boilerplate modular project to plugin to my main ASP.NET Zero solution. So far I have been able to achieve this using the Boilerplate documentation on plugins and embedded resources.

I want this project to be independent and testable on its own, and not part of the main solution. However, I want to still use the ASPNET Zero RAD tool to create entities and views in this separate project.

Is this possible by porting over the RAD Tool folder to this separate project, and/or changing the config files?

Thanks. Very cool of you. This is super helpful for learning the edits needed. I am attaching a compare for others to use as it might be helpful.

Showing 11 to 20 of 24 entries