About the role and function of the forum, some ideas

xiaoxiao2021-03-06  44

Today I consider the problem about role and function, I feel that this problem is better. .

A login Visitor can be made of multiple characters, each role is a class, all implementing this interface, if the current Visitor can delete the current post, is whether the delete button appears. Can use

For (int i = 0; i

VisitorUtils.get (i) .ShowdeleteButton (Reply, Visior);

}

This VisitorUtils is a Visitor's Collection, and the object inside Collection is a class that implements Irole.

Irole can have a method, showdeletebutton (reply r, vistor v), this ------

1. If the moderator is rewriting ShowdeleteButton (Reply r, Vistor V), find the version from the Vistor, find the version where the restore is found from the reply, and it is determined whether or not it can be displayed.

2. If it is the author of this reply, the corresponding judgment in ShowdeleteButton (Reply R, Vistor V) is OK.

I think so now. . .

转载请注明原文地址:https://www.9cbs.com/read-79809.html

New Post(0)