feat: Permissions for board members

Closes #262
This commit is contained in:
Maksim Eltyshev
2022-08-19 14:00:40 +02:00
parent 281cb4a71b
commit f9e0147f33
61 changed files with 1063 additions and 191 deletions

View File

@@ -3,17 +3,18 @@ import { connect } from 'react-redux';
import selectors from '../selectors';
import entryActions from '../entry-actions';
import { BoardMembershipRoles } from '../constants/Enums';
import BoardKanban from '../components/BoardKanban';
const mapStateToProps = (state) => {
const { cardId } = selectors.selectPath(state);
const isCurrentUserMember = selectors.selectIsCurrentUserMemberForCurrentBoard(state);
const currentUserMembership = selectors.selectCurrentUserMembershipForCurrentBoard(state);
const listIds = selectors.selectListIdsForCurrentBoard(state);
return {
listIds,
isCardModalOpened: !!cardId,
canEdit: isCurrentUserMember,
canEdit: !!currentUserMembership && currentUserMembership.role === BoardMembershipRoles.EDITOR,
};
};