localgovdrupal / localgov_microsites_group

LocalGov Drupal Microsites Group integration
1 stars 2 forks source link

Set if particular content types can be created in different Microsites #428

Closed ekes closed 3 months ago

ekes commented 1 year ago

I'll be honest here. My temptation is now to remove group_permissions and use custom entity access to set if content can be created - it will then always be possible to be viewed if it has been created.

_Originally posted by @ekes in https://github.com/localgovdrupal/localgov_microsites_group/issues/427#issuecomment-1772527308_

finnlewis commented 1 year ago

Good idea. I wonder how much time this would take?

If we can estimate the size of the job and upgrade paths, we can assess.

ekes commented 1 year ago

Well the migration to a field, supplied with modules, and a new hook... straightforward. I've done a fair bit when prodding.

However I am reminded why going for group_permissions in the first place was more 'straightforward'. As the group routes to create content, and probably other custom /group/{group}/... routes, use the plugin access which doesn't look at the entity_access hooks at all.

So we'd do entity access hooks and add additional access checks on specific routes or decorate the access service plugin further -- thinking about it the later might be best. But, it'd probably still be better for performance rather than entering the calculator on a per-group basis as group_permissions does, and it'd be 'simpler'. So probably still worth it for what we need which is the impression of particular content types per site and simple ui without the additional types.

ekes commented 6 months ago
finnlewis commented 6 months ago

Added this issue to write some tests: https://github.com/localgovdrupal/localgov_microsites_group/issues/464

ekes commented 5 months ago

Optional: see if this can be better done with a permissions service per group domain context

https://github.com/localgovdrupal/localgov_microsites_group/pull/470

Add more tests to ensure this is working correctly.

https://github.com/localgovdrupal/localgov_microsites_group/pull/469

finnlewis commented 3 months ago

https://github.com/localgovdrupal/localgov_microsites_group/pull/470 has been merged and released.

I think this can be closed, thanks @ekes !