Base solution for your next web application

Activities of "digitalcontrol"

Answer

Hi @ismcagdas Unfortuanatlly that is not solution, we already tried that option but since we need that public/private switch configurable (depend which option is active) we need it under app module. Another reason would be that we want same routes(URLs) in both situations. Can you give us some guidlines for doing this under app module? For now we are trying but hitting wall by wall

Answer

Are you still with us?

Answer

Hi, When we can expect some answer?

Answer

Is there any help regarding this situation?

Answer

Did you find anything useful?

Answer

If you can provide some more details it would be good. Here is what we've done. The question is "Is this good approach or there is something more convenient?". Frontend:

  • in auth-route-guard.ts we removed if (!this._sessionService.user) - so we don't get redirected to login page
  • in routing modules we removed data: { permission: '...' } where we wanted to open routes
  • in app-navigation.service.ts we removed permissions for the items we want to be visible to public users
  • in topbar.component.ts in setCurrentLoginInformations method we check first if appSession.user exists and then based on result we display in topbar username or login button
  • we removed all UserLinkServiceProxy service calls since we don't use them in out app
  • and commented the part of the code related to notifications for now, but that won't be a problem because we will just update endpoints to return appropriate response based on is user logged in or not Backend:
  • in ProfileAppService in GetProfilePicture method we check first if AbpSession.UserId.HasValue and then load profile picture, otherwise just return new GetProfilePictureOutput(string.Empty);
  • For now we just set attribute AbpAllowAnonymous in some app services for testing purposes, but we will add custom attribute where we will filter private/public data based on is user logged in or not

UserFriendlyException: User already in role 'User is not in role 'Administrator'. STACK TRACE: at Abp.IdentityFramework.IdentityResultExtensions.CheckErrors(IdentityResult identityResult, ILocalizationManager localizationManager) in D:\Github\aspnetboilerplate\src\Abp.ZeroCore\IdentityFramework\IdentityResultExtensions.cs:line 72 at PROJECT.PROJECTAppServiceBase.CheckErrors(IdentityResult identityResult) in C:\Work\PROJECT\PROJECT.Backend\src\PROJECT.Application\PROJECTAppServiceBase.cs:line 64 at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformSyncUow(IInvocation invocation, UnitOfWorkOptions options) in D:\Github\aspnetboilerplate\src\Abp\Domain\Uow\UnitOfWorkInterceptor.cs:line 68 at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.DynamicProxy.AbstractInvocation.Proceed() at PROJECT.Authorization.Users.UserAppService.UpdateUserAsync(CreateOrUpdateUserInput input) in C:\Work\PROJECT\PROJECT.Backend\src\PROJECT.Application\Authorization\Users\UserAppService.cs:line 505 at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinally(Task actualReturnValue, Func1 postAction, Action1 finalAction) in D:\Github\aspnetboilerplate\src\Abp\Threading\InternalAsyncHelper.cs:line 35 at PROJECT.Authorization.Users.UserAppService.CreateOrUpdateUser(CreateOrUpdateUserInput input) in C:\Work\PROJECT\PROJECT.Backend\src\PROJECT.Application\Authorization\Users\UserAppService.cs:line 342 at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()

We use ASP.NET Core & Angular, version 6.4.0. Framework type .NET Core 2.2. I can not reproduce this on Zero's demo. And this not happens in every case when I want to remove a role. But some role can not be removed and this exception is thrown.

This line throw error in UserManager.cs file:

Implementation of base SetRoles() method is in dll file so we can not see why this error is thrown. I was hoping that You will give us a reason for base.SetRoles() method throwing this exception.

Answer

We were investigating more what are our options but did not find an appropriate solution yet. We have page where we are listing users posts, each post has details page where are some comments (simple ticketing system, similar to your support forum) and we want to open Post listing page as well as Post details page to visitors who are not logged in (same as your support forum page) where these visitors can see the content but can not post or comment before they log in. An additional feature is that we need this configurable which means that these pages will be publicly accessible only if we set it to public under settings (In DB, let's say tenant configuration).

Answer

@ismcagdas I did but did not find anything useful, maybe you will something.

Showing 1 to 10 of 37 entries