In the AbpUser class, the "Name" and "Surname" fields are marked as Required by an attribute. I'm not sure why this would be enforced, as it is often valid to have a user without both name components, especially during registration. How can I inherit from AbpUser but without the Required validation on these fields? Thanks.
This has not occurred after starting a new project from template. Perhaps it was something random with the previous project setup? Thanks for following up.
Thanks. I'm going to try the route of copy/rename the Web project. It took a couple hours to fix up naming conflicts etc, but seems to run now.
Thanks. This is a web project to run as a separate web app but access the main database -- architecture is two websites, one as web project from template, and another running Hangfire as a scheduler. I can try copying the web project, although this seems like it could carry a lot of overhead just to get a simple web project working that doesn't require all the other infrastructure.
A simpler question: what needs to be done to ensure an entity can be eager loaded from a new project?
The question here actually might be how to handle dependency injection for a project that is not based on the ABP template. I've added a standard VS web project alongside the ABP projects in my solution. I've attempted to provide the IOC behavior this way:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
AbpBootstrapper bootstrapper = new AbpBootstrapper();
bootstrapper.Initialize();
bootstrapper.IocManager.RegisterIfNot<IAssemblyFinder, CurrentDomainAssemblyFinder>();
}
Is there a better way to ensure the functionality in other projects is resolved correctly especially for Entity Framework use?
I have an Entity Framework entity model that has a virtual navigation property for lazy loading. When using an Include extension method on the GetAll() from the template's Application project, it seems to work to eager load the property. However, I added an additional project to the solution and when calling the same method through an IAppService-based class , this error is thrown:
"The operation cannot be completed because the DbContext has been disposed."
Here is the method in my custom repository class:
public List<ActionDefinition> GetAllWithSchedule()
{
var query = GetAll();
var actions = query.Include(action => action.Schedule).ToList();
return actions;
}
What do I need to do to handle repository access from a different, new project not included in the template?
Thanks. My application version shows as v1.7.1.1
Also noticed my ABP modules were 0.7.7.2, so I upgraded to 0.7.8. Issue still exists.
The GetRolesForEdit call seems to happen fine, returning the object with array of permissions. Nothing in the server log.
Here's what Chrome shows in console:
<a class="postlink" href="http://screencast.com/t/4O6yIbGDegk">http://screencast.com/t/4O6yIbGDegk</a> <a class="postlink" href="http://screencast.com/t/j0aDEU6Ua">http://screencast.com/t/j0aDEU6Ua</a>
(Also confirmed in IE 11)
After some further testing I notice that user permission inheritance from role does seem to work for users I create but is broken for the built-in "admin" account where I first noticed the unexpected behavior.
It appears that in ABP authorization, if a user is a member of a role that is granted permission X, but doesn't have permission X granted directly on his user record, that the result is to deny X.
Is this correct? Shouldn't a user automatically inherit all the permissions for his assigned role(s)? In particular, if I later add a new new permission to a role, I would expect all the role members to be granted that permission. This doesn't seem to be the case now.