# One way moving task between columns restriction

**URL:** <https://kanboard.discourse.group/t/one-way-moving-task-between-columns-restriction/2839>\
**Category:** Questions\
**Created:** [June 24, 2023, 7:52am UTC](https://kanboard.discourse.group/t/one-way-moving-task-between-columns-restriction/2839 "2023-06-24T07:52:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gogoSpace](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/gogospace/32/1691_2.png) [@gogoSpace](https://kanboard.discourse.group/u/gogoSpace)\
**Post date:** [June 24, 2023, 7:52am UTC](https://kanboard.discourse.group/t/one-way-moving-task-between-columns-restriction/2839/1 "2023-06-24T07:52:04Z")

</div>

Is it possible to have restriction like this? To allow user moving task from column A to B, but deny from B to A?

---

<div class="post-metadata">

**Author:** ![gbs-matt](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/gbs-matt/32/1760_2.png) [@gbs-matt](https://kanboard.discourse.group/u/gbs-matt)\
**Post date:** [October 9, 2023, 2:21pm UTC](https://kanboard.discourse.group/t/one-way-moving-task-between-columns-restriction/2839/2 "2023-10-09T14:21:27Z")

</div>

I’ve just come across this. I assumed that the restriction was already one-way because it asks for a ‘source’ column and a ‘destination’ column and allows another restriction to be created in the opposite direction.

I’ve had a look at the code history on GitHub and it looks like it was a one-way restriction initially but was subsequently changed to two-way. I’ve re-enabled one-way restrictions on mine by removing 3 lines in the **app/helper/ProjectRoleHelper.php** file as shown below:

```auto
    public function canMoveTask($projectId, $srcColumnId, $dstColumnId)
    {
        $role = $this->getProjectUserRole($projectId);

        if ($this->role->isCustomProjectRole($role)) {
            if ($srcColumnId == $dstColumnId) {
                return true;
            }

            $sortableColumns = $this->columnMoveRestrictionCacheDecorator->getSortableColumns($projectId, $role);

            foreach ($sortableColumns as $column) {
                if ($column['src_column_id'] == $srcColumnId && $column['dst_column_id'] == $dstColumnId) {
                    return true;
                }

// Remove below this line
// if ($column['dst_column_id'] == $srcColumnId && $column['src_column_id'] == $dstColumnId) {
// return true;
// }
// Remove above this line
            }

            return empty($sortableColumns) && $this->isAllowedToMoveTask($projectId, $role);
        }

        return true;
    }

```
