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 = () =>
|
||||
projects.map(project => (
|
||||
<ListItem key={project.name} classes={{ root: styles.listItem }}>
|
||||
<ListItem key={project.id} classes={{ root: styles.listItem }}>
|
||||
<ListItemAvatar>
|
||||
<Icon>folder_open</Icon>
|
||||
</ListItemAvatar>
|
||||
@ -107,11 +107,11 @@ const ProjectList = ({ projects, fetchProjects, removeProject, history }) => {
|
||||
secondary={project.description}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={hasAccess(UPDATE_PROJECT, project.name)}
|
||||
condition={hasAccess(UPDATE_PROJECT, project.id)}
|
||||
show={mgmAccessButton(project)}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={hasAccess(DELETE_PROJECT, project.name)}
|
||||
condition={hasAccess(DELETE_PROJECT, project.id)}
|
||||
show={deleteProjectButton(project)}
|
||||
/>
|
||||
</ListItem>
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ProjectComponent from './form-project-component';
|
||||
import { createProject, validateId } from './../../store/project/actions';
|
||||
import { fetchUser } from './../../store/user/actions';
|
||||
|
||||
const mapStateToProps = () => ({
|
||||
project: { id: '', name: '', description: '' },
|
||||
@ -8,7 +9,10 @@ const mapStateToProps = () => ({
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
validateId,
|
||||
submit: project => createProject(project)(dispatch),
|
||||
submit: async project => {
|
||||
await createProject(project)(dispatch);
|
||||
fetchUser()(dispatch);
|
||||
},
|
||||
editMode: false,
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user