Skip to content

[ACCESS-CONTROL] Resource id validation in dto #85

@Jtplouffe

Description

@Jtplouffe

In dto, it would be nice to be able to validate that the user that sent the request has some permission on the resource id passed in the body.

For example:

export class MyDto {
    @IsDefined()
    @IsInt()
    @HasAccess({ resource: DataSources, action: AccessActions.Update })
    dataSourceId: number;
}

This may be doable with a global guard.

This would allow us to have routes that are less nested are cleaner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions