kartik-v / yii2-tree-manager

An advanced tree management module using nested sets for Yii 2.
http://demos.krajee.com/tree-manager
Other
150 stars 107 forks source link

Show/Hide nodes to a user #270

Closed fasi1208 closed 4 years ago

fasi1208 commented 4 years ago

I am able to add, remove, update nodes. There is one more requirement, that is to show/hide nodes on the basis of user access. i.e. when a user is given a specific node(s) then only that particular node(s) with all the child (if any) should be shown.

What I have done so far?

I have created a table user-node in which I am assigning a node id to a user as shown below.

image

What I want to do

Now I want to show only the specified node with its child node only and hide other nodes to that user

image

How can I achieve it?

kartik-v commented 4 years ago

Suggest you to read the documentation to understand the possibilities in this extension. Your use case can be achieved by reading about Tree Model Methods. You can override the isVisible method within the tree model to show the node selectively for the current user or anything based on your custom condition.