feat: 🎸 create manage custom scopes route and view (#2359)

* feat: 🎸 create manage custom scopes route and view

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13881

---------

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
Lisbet AlvarezandZhihe Li authored and Lisbet Alvarez committed 2024-07-15 17:23:00 -07:00
1 parent 89e072401c
commit 27abf9e2d9
24 files changed
+879 -68

No files matched your search

+26
View File
@@ -81,6 +81,32 @@ export default class RoleModel extends GeneratedRoleModel {
return grantScopes;
}
/**
* Helper for retrieving grant scope ids that are keywords.
* @type {string[]}
*/
get grantScopeKeywords() {
return this.grant_scope_ids.filter((id) =>
GRANT_SCOPE_KEYWORDS.includes(id),
);
}
/**
* Helper for retrieving grant_scope_ids that are orgs.
* @type {string[]}
*/
get grantScopeOrgIDs() {
return this.grant_scope_ids.filter((id) => id.startsWith('o_'));
}
/**
* Helper for retrieving grant_scope_ids that are projects.
* @type {string[]}
*/
get grantScopeProjectIDs() {
return this.grant_scope_ids.filter((id) => id.startsWith('p_'));
}
/**
* A list of IDs for principals of type `user`.
* @type {string[]}