authconstraint.java.svn-base

来自「用于JAVA的Web的权限过滤器」· SVN-BASE 代码 · 共 44 行

SVN-BASE
44
字号
package dev.trade.common.securityfilter.config;

import java.util.*;

/**
 * <p>Title: 权限过滤器</p>
 *
 * <p>Description: 验证配置</p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author Zheng YanNan
 * @version 1.0
 */
public class AuthConstraint {
   private Set roles;

   /**
    * Constructor
    */
   public AuthConstraint() {
      roles = new HashSet();
   }

   /**
    * Add a role.
    *
    * @param role role to add
    */
   public void addRole(String role) {
      roles.add(role);
   }

   /**
    * Get the roles collection.
    * Returns an empty collection if no roles were present in the config file.
    */
   public Collection getRoles() {
      return Collections.unmodifiableCollection(roles);
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?