django-cms / djangocms-versioning

General purpose versioning package for Django CMS 4 and above.
Other
34 stars 30 forks source link

feat: Add content object level publish permissions #390

Closed fsbraun closed 8 months ago

fsbraun commented 8 months ago

Description

This PR adds object-level permissions for publication to djangocms-verisoning.

If the versioned content model has a method called has_publish_permission versioning will use it to determine of the user can publish the object.

If not it falls back to has_change_permission, has_placeholder_change_permission and lastly on the user's model-level permission to change the content model.

Related resources

Checklist

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.50%. Comparing base (f90c5b2) to head (585a329). Report is 8 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #390 +/- ## ========================================== + Coverage 90.88% 91.50% +0.62% ========================================== Files 72 72 Lines 2546 2579 +33 Branches 361 368 +7 ========================================== + Hits 2314 2360 +46 + Misses 168 155 -13 Partials 64 64 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.