Skip to content
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

Add some time saving comments to cf permissions checker #4508

Merged
merged 1 commit into from
Aug 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ export class CfUserPermissionsChecker extends BaseCurrentUserPermissionsChecker
endpointGuid?: string,
orgOrSpaceGuid?: string,
allSpacesWithinOrg = false
) {
): Observable<boolean> {
// In some situations the observable returned here is not subscribed to (for example due to applyAdminCheck).
// This is bad (we should skip this function entirely) and should be fixed. This would require a thorough appraisal and overhaul.
if (type === CfPermissionTypes.ENDPOINT_SCOPE) {
if (!endpointGuid) {
return of(false);
Expand Down Expand Up @@ -357,6 +359,7 @@ export class CfUserPermissionsChecker extends BaseCurrentUserPermissionsChecker
return of(true);
}
if (isReadOnly) {
// This is bad, we should not assume that the check type wants a negative result if the user only has 'read only' rights.
return of(false);
}
return check$;
Expand Down