3 ms·
It might be more that whether the user is authorized to view something or a particular feature is enabled for some user is really mixing concerns the code shoul
by teeray 4y ago
It might be more that whether the user is authorized to view something or a particular feature is enabled for some user is really mixing concerns the code shouldn’t care about. Really what it cares about is “can the user do this thing”? How the decision is arrived at should be opaque to the code asking that question. It also probably makes it easier to test because you can just tell that section of the code “yes” or “no” through a stub of that permission / feature oracle.