/// <summary>
        ///
        /// </summary>
        /// <param name="roleDesp"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        public static bool UserInRoles(this RoleDescriptionAttribute roleDesp, IUser user)
        {
            bool result = false;

            if (roleDesp != null && user != null)
            {
                ApplicationAndPermissionObjectsCollection pods = PermissionDescriptionParser.ParseApplicationAndPermissionObjects(roleDesp.Description);

                foreach (ApplicationAndPermissionObjects pod in pods)
                {
                    foreach (string roleCodeName in pod.PermissionObjectCodeNames)
                    {
                        if (user.Roles[pod.ApplicationCodeName, roleCodeName] != null)
                        {
                            result = true;
                            break;
                        }
                    }

                    if (result)
                    {
                        break;
                    }
                }
            }

            return(result);
        }
        /// <summary>
        /// 是否包含权限的限制
        /// </summary>
        /// <param name="mi"></param>
        /// <returns></returns>
        private static bool HasPermissionRestricts(MemberInfo mi)
        {
            RoleDescriptionAttribute       roleDesp       = AttributeHelper.GetCustomAttribute <RoleDescriptionAttribute>(mi);
            PermissionDescriptionAttribute permissionDesp = AttributeHelper.GetCustomAttribute <PermissionDescriptionAttribute>(mi);
            RoleGroupsAttribute            roleGroups     = AttributeHelper.GetCustomAttribute <RoleGroupsAttribute>(mi);

            return(roleDesp != null || permissionDesp != null || roleGroups != null);
        }