abp icon indicating copy to clipboard operation
abp copied to clipboard

Missing Check*PolicyAsync usage in documentation?

Open Stirda opened this issue 6 years ago • 5 comments

In official tutorial the *PolicyName family is set in BookAppService ctor but I don't see any Check*PolicyAsync call in method overrides. Is this forgotten or is there an automagic somewhere calling them?

Stirda avatar Aug 26 '20 14:08 Stirda

hi

It will automatically check the policy in AbstractKeyCrudAppService class.

https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyCrudAppService.cs#L87

maliming avatar Aug 26 '20 14:08 maliming

@maliming I agree for CreateAsync. But tutorial overrides methods GetAsync and GetListAsync without calling any Check*PolicyAsync or base method.

Stirda avatar Aug 26 '20 15:08 Stirda

https://github.com/abpframework/abp/blob/27050189dc6653c851fa99ce191013c600a2bfad/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs#L63 https://github.com/abpframework/abp/blob/27050189dc6653c851fa99ce191013c600a2bfad/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs#L54

maliming avatar Aug 27 '20 00:08 maliming

@maliming Base classes are good. Tutorial overrides not seems so. Look at their bodies (https://docs.abp.io/en/abp/latest/Tutorials/Part-10?UI=MVC&DB=EF#bookappservice).

Stirda avatar Aug 27 '20 10:08 Stirda

You are right! Will be update the document.

maliming avatar Aug 27 '20 10:08 maliming