ArchUnit icon indicating copy to clipboard operation
ArchUnit copied to clipboard

LayerDependencySpecification should have a 'mayNotAccessLayers'

Open qoomon opened this issue 6 years ago • 4 comments

LayerDependencySpecification should have a 'mayNotAccessLayers' to prohibit specific access to other layers

qoomon avatar Mar 04 '19 15:03 qoomon

I had thought about offering an inverse way of specifying layers, too. I.e. allow whereLayer('foo').mayOnlyAccessLayer('bar'). I would call the method you propose to be named mayNotAccessAnyLayer() to be consistent with the existing mayNotBeAccessedByAnyLayer()

codecholeric avatar Mar 05 '19 15:03 codecholeric

Hello, I found this project very interesting and I wanna contribute, can you guys help me in my first steps ?

This issue can be made adding another property in LayerDependencySpecification ? like allowedAccessors Set, but for the access layers (instead the accessors one) ?

Fragalli avatar Sep 26 '19 03:09 Fragalli

@Fragalli oh man, I've completely overlooked your offer!! Are you still open to it? Or have you moved on? Anyway, I think your idea is how I would do it, too. I'd add some allowedTargets in LayerDependencySpecification additional to allowedAccessors and then where the rules for onlyHaveDependentsWhere(..) are added, also add onlyHaveDependenciesWhere(.., targetMatches(..)). That should pretty much be it, I guess...

codecholeric avatar Dec 30 '19 00:12 codecholeric

Hello! I wanted to contribute therefore I've picked up this issue (it could also be assigned to me?) I talked to @codecholeric since I also saw the discussion in #190, we agreed as a first step to add a white-list oriented mayOnlyAccessLayers() vs black-list oriented mayNotAccessLayers() due to the reasoning provided here. If this suffices, then we can close the issues, otherwise we can think again about adding the black list option as well :)

GiorgadzeLuka avatar May 02 '21 20:05 GiorgadzeLuka