Re-allow in class with/by attributes #305
spaze
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This bugfix release includes a better detection of disallowed attributes reallowed in a method with attributes (#304)
The original 4.3.0 release notes:
This release has been sponsored by @TicketSwap & @ruudk, thank you 🍰
Re-allow in class with/by attributes (#296, #298)
So far, when you wanted to re-allow a disallowed function or a method, or specifically disallow them, you could use:
allowIn
path to specify a path or a filename where the function or method could be called without generating an errorallowInMethods
(or theallowInFunctions
alias) to specify functions and methods in which the disallowed function would be alloweddisallowIn
ordisallowInMethods
(or theallowExceptIn[...]
aliases) if you wanted to list paths or methods in which the call is explicitly disallowedStarting with this release, you can use attributes to sort of mark functions and methods in which the disallowed call would be allowed (or explicitly disallowed):
allowInClassWithAttributes
to allow for example a method in a class that has a specified class attributeallowInMethodsWithAttributes
(or thedisallowInFunctionsWithAttributes
alias) to allow the call in methods (or function) with the given method attribute (or a function attribute)allowInClassWithMethodAttributes
to allow a call in a class where any method has the attribute, where "any method" includes any other method as well, static or not, public, private, or protecteddisallowIn[...]
counterparts (withallowExceptIn[...]
aliases) to specify only classes and methods in which the call should be disallowedThis allows you to create rules that do not depend on paths or method names, and can be useful if you're working with frameworks or libs that already use attributes. You can specify multiple items in the directives above and only one of them needs to match (it's not an AND list, more like OR list) and they all support
fnmatch
patterns.Other minor changes
fnmatch
less often only when needed (Callfnmatch
less often only when needed #297)disallowedAttributes
docs (Tweak attribute example #299, thanks @ruudk)You too can sponsor a release or buy me a 🍻 or a 🍰, thanks!
This discussion was created from the release Re-allow in class with/by attributes.
Beta Was this translation helpful? Give feedback.
All reactions