masugadesign / lab-reports-craft-cms

Other
2 stars 1 forks source link

Unable to delete a report? #5

Closed angieherrera closed 1 year ago

angieherrera commented 1 year ago

Unless I missed something, I don't see a way to delete a report?

I deleted the template for the report in the config folder but the report still shows in the CP. The delete option is grayed out in the CP if I try that way.

amici-infotech commented 1 year ago

I am having this issue too. Can't delete the report.

image

amici-infotech commented 1 year ago

After debug I found we need to add 2 functions into element class. I've added this into ConfiguredReport.php file.

// At top
use craft\elements\User;

// Under class
public function canView(User $user): bool
{
    return true;
}

public function canDelete(User $user): bool
{
    return true;
}
benjaminkohl commented 1 year ago

Thank you for bringing this to my attention. I'll be sure to address permissions issues in a future release. I don't think Craft always enforced these unless they were explicitly defined on the element. I never had any intention of getting that granular with the plugin permissions.

benjaminkohl commented 1 year ago

I just released Lab Reports 2.0.3 which will address the permissions issues that I think may have come about in Craft 4.3 (did some digging and comparing of Craft 4 releases).