mirror of
https://github.com/plankanban/planka.git
synced 2025-08-03 04:25:27 +02:00
fix: Hide label actions based on role
This commit is contained in:
parent
bf8b8474ec
commit
064b37050c
6 changed files with 70 additions and 39 deletions
|
@ -3,6 +3,7 @@ import { connect } from 'react-redux';
|
|||
|
||||
import selectors from '../selectors';
|
||||
import entryActions from '../entry-actions';
|
||||
import { BoardMembershipRoles } from '../constants/Enums';
|
||||
import BoardActions from '../components/BoardActions';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
|
@ -12,6 +13,7 @@ const mapStateToProps = (state) => {
|
|||
const labels = selectors.selectLabelsForCurrentBoard(state);
|
||||
const filterUsers = selectors.selectFilterUsersForCurrentBoard(state);
|
||||
const filterLabels = selectors.selectFilterLabelsForCurrentBoard(state);
|
||||
const currentUserMembership = selectors.selectCurrentUserMembershipForCurrentBoard(state);
|
||||
|
||||
return {
|
||||
memberships,
|
||||
|
@ -19,6 +21,7 @@ const mapStateToProps = (state) => {
|
|||
filterUsers,
|
||||
filterLabels,
|
||||
allUsers,
|
||||
canEdit: !!currentUserMembership && currentUserMembership.role === BoardMembershipRoles.EDITOR,
|
||||
canEditMemberships: isCurrentUserManager,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue