-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide app vars tab if user is not a space developer #3247
Conversation
✅ Hey nwmac! The commit authors and yourself have already signed the CLA. |
Codecov Report
@@ Coverage Diff @@
## v2-master #3247 +/- ##
=============================================
- Coverage 71.04% 71.01% -0.03%
=============================================
Files 634 639 +5
Lines 27827 28029 +202
Branches 6336 6387 +51
=============================================
+ Hits 19769 19906 +137
- Misses 8058 8123 +65 |
secrets.yaml.sys
Outdated
@@ -0,0 +1,57 @@ | |||
# E2E Configuration file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this file be in the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
@@ -213,6 +215,15 @@ export class ApplicationService { | |||
this.appEnvVars = this.appEnvVarsService.createEnvVarsObs(this.appGuid, this.cfGuid); | |||
} | |||
|
|||
public getApplicationEnvVarsMonitor() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better placed in ApplicationEnvVarsHelper alongside createEnvVarsObs
@@ -110,9 +111,28 @@ export class ApplicationTabsBaseComponent implements OnInit, OnDestroy { | |||
} | |||
}); | |||
|
|||
// Listen for the response to the env vars API call - if it errors then we hide the variables tab | |||
// This is simpler than the code to check permissions since we make the env vars request anyway | |||
const appDoesNotHaveEnvVars$ = this.applicationService.getApplicationEnvVarsMonitor().entityRequest$.pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think we should stick to the permissions. That way the user can then refresh the list and still see the env vars. To switch would need to
- Add new
ENV_VARS_VIEW
entry to theCurrentUserPermissions
enum in current-user-ermissions.config.ts - Add entry for new enum value to
permissionConfigs
in the same file (which just needs to be look for space dev) - In
application-tabs-base.component.ts
importCurrentUserPermissionsService
and use it'scan
function with something likecan(<new env vars view enum>, <endppoint guid>, <space giud>)
Fixes #2725