Suddenly, my application started to return 500 Internal Server Error if a UserFriendlyException is thrown. For example when the user tries to log in with wrong credentials. Since the the handling of this error (mapping it to a user friendly exception that is shown on the client side) happens inside the aspnetboilerplate dlls I have almost no chance to figure out why. I am now looking for some checkpoints that could cause this behavior? I am using version 0.8.4. Thank you for your help.
Edit:
The only thing I get from the output window is: Exception thrown: 'Abp.UI.UserFriendlyException' in MyApplication.Web.dll Exception thrown: 'Abp.UI.UserFriendlyException' in mscorlib.dll
Also the exception event is not fired (IEventHandler<AbpHandledExceptionData>).
Hi
How can I get all users with a specific permission? Since users and roles are not directly coupled I didn't figure out a proper way to do this with a linq query.
I was asking myself if it is a good practice to have a different outcome / behaviour of a service method based on permissions? For example, the GetAll method in a service might return only the objects that I have created if I a do not have a "see all"-permission. Or the update method might ignore some properties if I do not have the permission to edit all properties of a given object.
I have this notion that one has the permission to either call an action or not. Maybe I am wrong with that one?
The impersonation feature works fine when runnig the application (version 0.8.4) on my local machine from Visual Studio. However, as soon as I run the application on IIS 8, the impersonation does not work anymore. The reason is that the built in cache manager (not using redis) seems to have some sort of a problem.
Within the AccountController (as is from the aspnetzero template) the impersonation token is put in the cache to be retrieved by the next action method (ImpersonateSignIn). However, at this point, the cache is empty when running on IIS 8.
public virtual async Task<JsonResult> Impersonate(ImpersonateModel model)
{
// ...
var result = await SaveImpersonationTokenAndGetTargetUrl(model.TenantId, model.UserId, false);
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
return result;
}
[UnitOfWork]
public virtual async Task<ActionResult> ImpersonateSignIn(string tokenId)
{
var cacheItem = await _cacheManager.GetImpersonationCache().GetOrDefaultAsync(tokenId);
if (cacheItem == null)
{
// gets thrown on IIS 8 but not on localhost
throw new UserFriendlyException(L("ImpersonationTokenErrorMessage"));
}
// ...
}
Thank you for your help =).
To allow for statistics on an entity class I need to somehow log changes with the current date of a small set of properties for that specific entity. However, since there are dozens of ways to do this (technically) I was wondering on how to properly do this?
I noticed that some of the application "logic" is inside mvc controllers like the ProfileController or FileController. I was now wondering why? My guess is, that those APIs are consumed by 3rd party javascript libraries and therefore must not wrap their results in DTOs.
To allow for spatial search with MS SQL, Entity Framework provides the namespace System.Data.Entity.Spatial that includes the type DbGeography. This property enables me to easily do spatial searches with Entity Framework like so:
var university = (from u in context.Universities
orderby u.Location.Distance(myLocation)
select u).FirstOrDefault();
However, this feature is heavily database related and depends on the Entity Framework which in turn would mean that the Domain Model depends on the OR-Mapper which is kinda ugly. Is there a recommended approach to somehow use this feature without my Domain Model being dependent on the actual OR-Mapper?
Unfortunately, the documentation for the DTOs does not say much about the IOutputDto interface. Only that the interface should be implemented by "output DTOs". So, whats the technical reason to implement that interface?
Within the app.js are the route configurations like this:
$stateProvider.state('tenant.settings', {
url: '/settings',
templateUrl: '~/App/tenant/views/settings/index.cshtml',
menu: 'Administration.Settings.Tenant'
});
There is this "menu" property which does not seem to be an official property at all. See $stateProvider API. From the ASP.NET Zero Getting Started tutorial, all I know is that this property has something to do with the highlighting of the currently active menu in the navbar. Since in my case this highlighting mechanism is somewhat buggy I would like to know where this menu property gets processed / handled to further investigate my issues.
For my application project, I need to consume some of the services that are provided by the Bing Map API (web services). So far, I wasn't able to find the right place in the ASP.NET Zero Solution to put those service calls in a way, that is unit test compatible. Also, those bing map services are not meant to be directly invoked by the presentation layer.
First I though of the application service layer. But that seems wrong since the application service layer is meant to be directly accessed by the presentation layer.
Then I checked the domain service layer which is only accessible by the application service layer, but not by the presentation layer. But to me, the domain service layer seems more, like its name already suggests, domain related whereas the bing map is not within the domain.
Now I am looking for an answer where one would put this bing map api calls within the ASP.NET Zero solution? The class that wraps those calls should be unit testable and registered to the dependency injection system.