Base solution for your next web application

Activities of "bma"

We are using BackgroundJob and IBackgroundJobManager for certain async operations. We need to be able to configure the retry count or total time before the job is set to failed state; either globally or per BackgroundJob. So far we have not found any way to set these. Can someone help?

hi ismcagdas

It was running in prod mode.

We figure out that we need to config to JsonResult specific for this ajax based multi-part form.

The probelm is solved - ty ;-)

Hi @ismcgdas

FYI;


// this is the service method
public async Task<int> UploadFile(FileDto fileDto)
{
    // if (some logic to check fro duplicates)
    throw new UserFriendlyException(409, "File already exists");
   
    // some logic to add record to db and save file on disc
   
    return 1;
}
   
   
public class FileDto
{
    public int FileGroupId { get; set; }
   
    // some other fields with primitive types
   
    [Required]
    public IFormFile File { get; set; }
}

Our problem seems to be on server side.. we are expecting following response from the API endpoint { "result": null, "targetUrl": null, "success": false, "error": { "code": 409, "message": "File already exists!", "details": null, "validationErrors": null }, "unAuthorizedRequest": false, "__abp": true } but we are getting raw exception response instead..

We are facing problem with an endpoint that we are using for file upload. We want to send back error messages with different codes e.g. 409. We are throwing UserFriendlyException from service layer and instead of getting the standard Abp wrapper response, we are getting the actual exception like this

Abp.UI.UserFriendlyException: File with same name already exists. at ........

All of the responses in rest of the application are being wrapped in Abp standard response object and we have not added any attribute on this endpoint which would tell it not to do so. Are we missing something?

TY

!Product : zero 9.2.1, Angular, .net core

Ok - ty for the quick response ;-)

Will SetGrantedPermissionsAsync save the permission for this user in DB? Or only for session...

If SetGrantedPermissionsAsync stores in DB > then Permission will be carried on to the next Case and therefor not solve the problem....

But the role is not assigned in advance as it is case related. Eg. can I have the role "CanEdit" on 1 case (# 9873) and on another case (# 439988) I have the "Approver" role. Without at the same time having the role of CanEdit as I had on the other case. In other words; i need to find permissions from a Role runtime and add them on a user. How can I do that? Hope it makes sense.

Let me try to explain better ;-)

We have an entity; Case

For Case, we have a number of permissions. It could, for example. be: Can upload file to Case. Another could be; Can edit Case metadata. We intend to use the built-in Roles and Permissions from .Zero to deal with this.

What we need beyond this is that a given Role (R1) only gives Rights to a given Case (C1) and that R1 does not automatically give rights to C2. In other words; a User (U1) has only R1 to C1 if there is a relationship between U1 and C1

I think the solution is to inject the User - Case relation check, in the permission check - but not sure.

Hello everyone

I am very excited that we are going to start developing a portal based on .Zero ;-)

I'm also excited to start using this forum. In the beginning, it is probably most questions that are asked, but I hope that at some point I can also start helping others.

And now to my question; i'm looking for a way to create a relationship between a Role and a Tuple. I need a user to have a role (R1) that only applies to a certain tuple (T1). The same user can have R1 for T2, but not automatically for T3, Txx. I would like to use a much as possible from Abp User and Role management.

Hope it makes sense and someone can point me in the right direction. Thx.

!Product : zero 9.2.1, Angular, .net core

Showing 1 to 9 of 9 entries