Ensure lists for resources that don't have schema attributes.verbs LIST aren't shown#16398
Conversation
c729fa5 to
44a8a69
Compare
| @@ -5,6 +5,12 @@ const hasFetch = (component) => component.$options && typeof component.$options. | |||
| export const addLifecycleHook = (vm, hook, fn) => { | |||
| if (!vm.$options[hook]) { | |||
| vm.$options[hook] = []; | |||
| } else if (!Array.isArray(vm.$options[hook]) && typeof vm.$options[hook] === 'function' ) { | |||
There was a problem hiding this comment.
without this the fetch would not run in components with beforeMount and mixins which had no beforeMounts
|
|
||
| const verbs = schema.attributes?.verbs || []; | ||
|
|
||
| if ( !verbs.includes('list') ) { |
There was a problem hiding this comment.
Spoofed lists should always have LIST permissions
44a8a69 to
af26fe5
Compare
codyrancher
left a comment
There was a problem hiding this comment.
In the future should we be checking for the get verb or using canList in all the places we're doing permissions with schemaFor?
0056df7 to
8ec2117
Compare
f712dea to
4724de1
Compare
|
@codyrancher exactly that. before we just checked if the schema was accessible then assumed all get/list was allowed. going forward we should use the new canGet and updated canList getters. I recently updated the pr with the canGet to solve an issue with the user activity stuff (we were trying to canList a resource which only supported Get), so worth another quick review |
- an alternative was to disable the navigation, however that would involve changes to the same component that handles the side bar
- user activity was broken given
- we were calling canList on an unlistable resource
- fixed by creating a new canGet store store getter
- we were using canList on a norman schema, which used the new steve specific check for attributes
- fixed by having norman specific canList
- changes
- move canList and create new canGet in root store
- their functionality should be the same as before
- point canList and new canGet to model getters
- add root canList and canGet that behaved as before
- add steve specific canList and canGet that looks at attribute verbs
4724de1 to
ac32e2d
Compare
|
Note to self, this requires squash merging |
Squash with just the ascii art commit message |
Summary
Fixes #15453
Occurred changes and/or fixed issues
Areas or cases that should be tested
Areas which could experience regressions
Checklist
Admin,Standard UserandUser Base