我想有条件地添加春天视图。无法找到办法做到这一点。有人可以帮助我。
前 - 我有2个视图如下,基于已登录的用户,我想只显示其中一个,另一个即使通过像http://localhost:7071/#!view2这样的网址也不可用
@SpringView(name = "view1")
public class View1 extends VerticalLayout { ... }
@SpringView(name = "view2")
public class View2 extends VerticalLayout { ... }
使用这样的安全控制:
import org.apache.shiro.authz.annotation.RequiresRoles;
@SpringView(name = "view1")
@RequiresRoles(value = "ROLE1")
public class View1 extends VerticalLayout { ... }
@SpringView(name = "view2")
@RequiresRoles(value = "ROLE2")
public class View2 extends VerticalLayout { ... }