Skip to content

Commit

Permalink
Add some time saving comments to cf permissions checker (#4508)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox authored Aug 20, 2020
1 parent ad64761 commit d27a12d
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit d27a12d

Please sign in to comment.