Algo-Web / POData-Laravel

Composer Package to provide Odata functionality to Laravel
MIT License
34 stars 29 forks source link

Hoist whitelist/blacklist checks further up stack #242

Open CyberiaResurrection opened 4 years ago

CyberiaResurrection commented 4 years ago

The current approach, especially for retrieving relationships, can be fraught with problems.

Line 89 of ModelReflectionHelper executes the relation method directly, which exposes execution to any and all exception throws, typos, etc. Whitelisting/blacklisting is currently applied after all fields, casts and relations are processed.

Best idea I've got at the moment is to apply getHidden/getVisible inside getModelClassMethods of the ModelReflectionHelper to (attempt to) obviate those calls.