Example #1
0
        private AuthorizeInfo VerifyAuthorize(string token)
        {
            if (permissionModule != null)
            {
                if (!permissionManagement.HasLoad)
                {
                    lock (permissionManagement) {
                        if (!permissionManagement.HasLoad)
                        {
                            permissionManagement.SetRoles(permissionModule.GetRoles());
                        }
                    }
                }
            }

            var verifyInfo    = authorizeModule.VerifyToken(token);
            var authorizeInfo = new AuthorizeInfo()
            {
                Id         = verifyInfo.Id,
                Account    = verifyInfo.Account,
                CreateTime = verifyInfo.CreateTime,
                Key        = verifyInfo.Key,
                Name       = verifyInfo.Name,
                Roles      = permissionManagement.GetRoleCollection(verifyInfo.Roles)
            };

            return(authorizeInfo);
        }
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public bool ResetRolePermission()
 {
     if (permissionModule == null)
     {
         return(false);
     }
     permissionManagement.SetRoles(permissionModule.GetRoles());
     return(true);
 }