Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roles->remove() recursive not clean the relationship with Permission and User with its descendants #110

Closed
cw1427 opened this issue Nov 16, 2018 · 0 comments

Comments

@cw1427
Copy link

cw1427 commented Nov 16, 2018

The function roles->remove() recursive not clean the relationship with Permission and User with its descendants.

It looks like whenever u want to remove the node itself or with its descendants, It only do the relationship tables with permission and User by itself but not care about its descendants relationship records in the relationtable.

I know it would works as expected because the entity ID is gone, There would not have any problem in the relationship table. But it is dirty data. I don't like to keep them in the tables.

   function remove($ID, $Recursive = false)
{
	$this->unassignPermissions ( $ID );
	$this->unassignUsers ( $ID );
	if (! $Recursive)
		return $this->roles->deleteConditional ( "ID=?", $ID );
	else
		return $this->roles->deleteSubtreeConditional ( "ID=?", $ID );
}
@cw1427 cw1427 closed this as completed Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant