-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
fix: disallow users from viewing other user's profile on config #21302
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ import ImportModelsModal from 'src/components/ImportModal/index'; | |
|
||
import Dashboard from 'src/dashboard/containers/Dashboard'; | ||
import CertifiedBadge from 'src/components/CertifiedBadge'; | ||
import { bootstrapData } from 'src/preamble'; | ||
import DashboardCard from './DashboardCard'; | ||
import { DashboardStatus } from './types'; | ||
|
||
|
@@ -132,6 +133,8 @@ function DashboardList(props: DashboardListProps) { | |
const [importingDashboard, showImportModal] = useState<boolean>(false); | ||
const [passwordFields, setPasswordFields] = useState<string[]>([]); | ||
const [preparingExport, setPreparingExport] = useState<boolean>(false); | ||
const enableBroadUserAccess = | ||
bootstrapData?.common?.conf?.ENABLE_BROAD_ACTIVITY_ACCESS || false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
|
||
const openDashboardImportModal = () => { | ||
showImportModal(true); | ||
|
@@ -290,7 +293,12 @@ function DashboardList(props: DashboardListProps) { | |
changed_by_url: changedByUrl, | ||
}, | ||
}, | ||
}: any) => <a href={changedByUrl}>{changedByName}</a>, | ||
}: any) => | ||
enableBroadUserAccess ? ( | ||
<a href={changedByUrl}>{changedByName}</a> | ||
) : ( | ||
<>{changedByName}</> | ||
), | ||
Header: t('Modified by'), | ||
accessor: 'changed_by.first_name', | ||
size: 'xl', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1335,6 +1335,7 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument | |
MENU_HIDE_USER_INFO = False | ||
|
||
# Set to False to only allow viewing own recent activity | ||
# or to disallow users from viewing other users profile page | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the code we are just removing the links to the profiles. Is there anything else that is actually blocking the user to visit a profile? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, on the backend change, the call to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok thanks for adding that |
||
ENABLE_BROAD_ACTIVITY_ACCESS = True | ||
|
||
# the advanced data type key should correspond to that set in the column metadata | ||
|
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.
Probably better safe than sorry, but in a similar context on the backend we always do
config["ENABLE_BROAD_ACTIVITY_ACCESS"]
instead of ``config.get("ENABLE_BROAD_ACTIVITY_ACCESS")`, since we assume the variable should always be defined. So maybe we could get by with(arguably that whole
bootstrapData
object with all nested fields should also be fully available)