Simply, can we apply the authorized and permission attributes at the property level like calss or methods? Basicallt, I want to filter some peoperties based on the caller permissions. Thanks :ugeek:
I have got the following classes/interface:
public interface IJobManager
{
Task<Job> Publish(Job job);
}
public class JobManager: IJobManager
{
private readonly IUnitOfWorkManager _unitOfWorkManager;
private readonly ILocalizationManager _localizationManager;
private readonly IRepository<Job, long> _jobRepository;
public JobManager(
IUnitOfWorkManager unitOfWorkManager,
ILocalizationManager localizationManager,
IRepository<Job, long> jobRepository
)
{
_unitOfWorkManager = unitOfWorkManager;
_localizationManager = localizationManager;
_jobRepository = jobRepository;
}
public async Task<Job> Publish(Job job) {
//ToDo: Check the available credit
job.PublishStart = DateTime.Now;
return job;
}
}
public class JobAppService : AgbizCareersDemoAppServiceBase, IJobAppService
{
private readonly IRepository<Job, long> _jobRepository;
private readonly IJobManager _jobManager;
public JobAppService(
IRepository<Job, long> jobRepository,
IJobManager jobManager)
{
_jobRepository = jobRepository;
_jobManager = jobManager;
}
[AbpAuthorize(AppPermissions.Pages_Job_Manage)]
public async Task<JobDto> PublishJob(EntityDto<long> input)
{
var job = await _jobRepository.GetOwnAsync(input.Id);
job = await _jobManager.Publish(job);
return ObjectMapper.Map<JobDto>(job);
}
}
I am getting the following error in the log file:
'AgbizCareersDemo.Jobs.JobAppService' is waiting for the following dependencies:
- Service 'AgbizCareersDemo.Jobs.IJobManager' which was not registered.
Castle.MicroKernel.Handlers.HandlerException: Can't create component 'AgbizCareersDemo.Jobs.JobAppService' as it has dependencies to be satisfied.
I have already created a service class in my other projects and I didn't have to resolve any dependency myself. Has anything been changed in that regard in the recent update?
Hey fellas, can somebody please guide me on how to debug an AppService with AbpAuthorize attribute via swagger? I know that I should pass something in the header to fulfill the authorization requirements but not sure what! Is there any particular setting in the application itself or swagger that I could set to dismiss the authorization attribute temporarily for testing methods functionalities purposes?
Cheers,
Hi, can somebody please let me know why the functions and business logic for User (and Role) has been divided into 2 different places (UserManager and UserAppService)? I can see that the UserAppService sometimes using the functions within the UserManager. I am trying to understand the reason behind it so I could fallow the same principle with my own entities. In all demo and sample projects I have seen so far, all the business logic is supposed to be within the AppServices classes.
Thanks,
Hi, How many nested level we can have within an AppMenuItem? I have got a side menu and trying to have 2 nested sub-menus but seems not more than one nested sub-menu is supported. Right?
new AppMenuItem('Administration', '', 'flaticon-interface-8', '', [
new AppMenuItem('Jobs', 'Pages.Administration.Jobs', 'fa fa-tachometer', '', [
new AppMenuItem('JobLocations', 'Pages.Administration.Jobs.Locations', 'fa fa-map-marker', '/app/admin/job-locations'),
new AppMenuItem('JobClassifications', 'Pages.Administration.Jobs.Classifications', 'fa fa-object-group', '/app/admin/job-classifications'),
]),
new AppMenuItem('OrganizationUnits', 'Pages.Administration.OrganizationUnits', 'flaticon-map', '/app/admin/organization-units'),
])
Hi, I have just noticed the second parameter of the UpdateAsync method:
Task<TEntity> UpdateAsync(TPrimaryKey id, Func<TEntity, Task> updateAction);
Just wonder if there is any way of limiting users to Delete\Update their own entities by providing the second parameter of the method to check if entity is not for the user then cancel the entire updating process followed by a message that "you can't modify this entity!". I am literally looking for a generic way to limit users to their own entities rather than every time checking if the selected entity is for the user taking an action or not!
Any comment and a sample code would be much appreciated :)
Hi, I have got a situation where I have to have 2 API with a same name and signatures as below:
namespace HomeStart.HomeStart.**AMS**
{
public interface IAMSAppService : IApplicationService
{
Task<SearchLoanOutput> SearchLoan(SearchLoanInput input);
}
}
namespace HomeStart.HomeStart.**Broker**
{
public interface IBrokerAppService : IApplicationService
{
Task<SearchLoanOutput> SearchLoan(SearchLoanInput input);
}
}
As you can see they are in 2 different namespaces. The problem seems around the SearchLoanInput and SearchLoanOutput though. I have created 2 sets of input and output for each within different namespaces (Dto). For some reason when I run the app the swagger does not get loaded and shows an error as: 500 : <a class="postlink" href="http://localhost:22742/swagger/v1/swagger.json">http://localhost:22742/swagger/v1/swagger.json</a>
Any thought?!
Hi All, Perhaps a simple inquiry: I have got a service guarded with permission attribute. How would I be able to call that service via Swagger? At the moment I am getting "Current user did not login to the application!" error which is right. But wonder if there is a way of bypassing the Authentication somehow from Swagger?
Regards,
Hi, I have just created a template as per the following specs: Project Type: ASP.NET CORE & Angular Project Version: v4.5.1 (Latest) Framework: .Net Framework 4.6.1
And receiving lots off incompatible errors as:
Severity Code Description Project File Line Suppression State
Error Package Microsoft.AspNetCore.Owin 2.0.0 is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Package Microsoft.AspNetCore.Owin 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Or
Severity Code Description Project File Line Suppression State
Error Package Abp.AspNetCore 3.0.0 is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Package Abp.AspNetCore 3.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
....
Any thoughts?
Hi All, I am proposing a migration plan for 20 different applications using ABP framework. One of the biggest deal is that we need to have one authentication/authorisation service for all the apps. Any idea if I can use existing templates provided by ABP Framework to achieve it?