mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: Project actions need to checkAccess based on projectId
This commit is contained in:
parent
5bbd0a734b
commit
cf1cae9b84
@ -98,7 +98,7 @@ const ProjectList = ({ projects, fetchProjects, removeProject, history }) => {
|
|||||||
|
|
||||||
const renderProjectList = () =>
|
const renderProjectList = () =>
|
||||||
projects.map(project => (
|
projects.map(project => (
|
||||||
<ListItem key={project.name} classes={{ root: styles.listItem }}>
|
<ListItem key={project.id} classes={{ root: styles.listItem }}>
|
||||||
<ListItemAvatar>
|
<ListItemAvatar>
|
||||||
<Icon>folder_open</Icon>
|
<Icon>folder_open</Icon>
|
||||||
</ListItemAvatar>
|
</ListItemAvatar>
|
||||||
@ -107,11 +107,11 @@ const ProjectList = ({ projects, fetchProjects, removeProject, history }) => {
|
|||||||
secondary={project.description}
|
secondary={project.description}
|
||||||
/>
|
/>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={hasAccess(UPDATE_PROJECT, project.name)}
|
condition={hasAccess(UPDATE_PROJECT, project.id)}
|
||||||
show={mgmAccessButton(project)}
|
show={mgmAccessButton(project)}
|
||||||
/>
|
/>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={hasAccess(DELETE_PROJECT, project.name)}
|
condition={hasAccess(DELETE_PROJECT, project.id)}
|
||||||
show={deleteProjectButton(project)}
|
show={deleteProjectButton(project)}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import ProjectComponent from './form-project-component';
|
import ProjectComponent from './form-project-component';
|
||||||
import { createProject, validateId } from './../../store/project/actions';
|
import { createProject, validateId } from './../../store/project/actions';
|
||||||
|
import { fetchUser } from './../../store/user/actions';
|
||||||
|
|
||||||
const mapStateToProps = () => ({
|
const mapStateToProps = () => ({
|
||||||
project: { id: '', name: '', description: '' },
|
project: { id: '', name: '', description: '' },
|
||||||
@ -8,7 +9,10 @@ const mapStateToProps = () => ({
|
|||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
validateId,
|
validateId,
|
||||||
submit: project => createProject(project)(dispatch),
|
submit: async project => {
|
||||||
|
await createProject(project)(dispatch);
|
||||||
|
fetchUser()(dispatch);
|
||||||
|
},
|
||||||
editMode: false,
|
editMode: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user