mirror of https://github.com/rancher/dashboard.git
Ensure create role button shows in Roles page
- take into account blocked-PUT
This commit is contained in:
parent
cc06b21e0a
commit
2a213ac8a5
|
|
@ -27,6 +27,8 @@ const createRoleTemplate = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const createVerbs = new Set(['PUT', 'blocked-PUT']);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Roles',
|
name: 'Roles',
|
||||||
|
|
||||||
|
|
@ -55,7 +57,7 @@ export default {
|
||||||
tabs: {
|
tabs: {
|
||||||
[GLOBAL]: {
|
[GLOBAL]: {
|
||||||
canFetch: globalRoleSchema?.collectionMethods.find(verb => verb === 'GET'),
|
canFetch: globalRoleSchema?.collectionMethods.find(verb => verb === 'GET'),
|
||||||
canCreate: globalRoleSchema?.resourceMethods.find(verb => verb === 'PUT'),
|
canCreate: globalRoleSchema?.resourceMethods.find(verb => createVerbs.has(verb)),
|
||||||
weight: 3,
|
weight: 3,
|
||||||
labelKey: SUBTYPE_MAPPING.GLOBAL.labelKey,
|
labelKey: SUBTYPE_MAPPING.GLOBAL.labelKey,
|
||||||
schema: globalRoleSchema,
|
schema: globalRoleSchema,
|
||||||
|
|
@ -66,7 +68,7 @@ export default {
|
||||||
},
|
},
|
||||||
[CLUSTER]: {
|
[CLUSTER]: {
|
||||||
canFetch: roleTemplatesSchema?.collectionMethods.find(verb => verb === 'GET'),
|
canFetch: roleTemplatesSchema?.collectionMethods.find(verb => verb === 'GET'),
|
||||||
canCreate: roleTemplatesSchema?.resourceMethods.find(verb => verb === 'PUT'),
|
canCreate: roleTemplatesSchema?.resourceMethods.find(verb => createVerbs.has(verb)),
|
||||||
labelKey: SUBTYPE_MAPPING.CLUSTER.labelKey,
|
labelKey: SUBTYPE_MAPPING.CLUSTER.labelKey,
|
||||||
weight: 2,
|
weight: 2,
|
||||||
schema: roleTemplatesSchema,
|
schema: roleTemplatesSchema,
|
||||||
|
|
@ -78,7 +80,7 @@ export default {
|
||||||
},
|
},
|
||||||
[PROJECT]: {
|
[PROJECT]: {
|
||||||
canFetch: roleTemplatesSchema?.collectionMethods.find(verb => verb === 'GET'),
|
canFetch: roleTemplatesSchema?.collectionMethods.find(verb => verb === 'GET'),
|
||||||
canCreate: roleTemplatesSchema?.resourceMethods.find(verb => verb === 'PUT'),
|
canCreate: roleTemplatesSchema?.resourceMethods.find(verb => createVerbs.has(verb)),
|
||||||
labelKey: SUBTYPE_MAPPING.NAMESPACE.labelKey,
|
labelKey: SUBTYPE_MAPPING.NAMESPACE.labelKey,
|
||||||
weight: 1,
|
weight: 1,
|
||||||
schema: roleTemplatesSchema,
|
schema: roleTemplatesSchema,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue