WorkspacePermission workspacePerm = WorkspacePermission.newInstance(doGetCurrentWorkspace(), WorkspacePermission.ACTION_LOGIN);
if (!getUserStatus().hasPermission(workspacePerm)) return false;
if (getCurrentSectionId() != null) {
SectionPermission sectionPerm = SectionPermission.newInstance(doGetCurrentSection(), SectionPermission.ACTION_VIEW);
if (!getUserStatus().hasPermission(sectionPerm)) return false;
} else { //Config is valid when there is no current section, but user can admin workspace.
WorkspacePermission adminWorkspacePerm = WorkspacePermission.newInstance(doGetCurrentWorkspace(), WorkspacePermission.ACTION_ADMIN);
if (!getUserStatus().hasPermission(adminWorkspacePerm)) return false;
}