Exemple #1
0
        public static void BindUser(this Public Public, string UserID, string BindID, string BindProvider)
        {
            UserBind factor = new UserBind()
            {
                BindID       = BindID,
                BindProvider = BindProvider
            };
            EntityQueryRequest <UserBind> query = new EntityQueryRequest <UserBind>();

            query.AppendConditionMap(factor.BindID, () => factor.BindID);
            query.AppendConditionMap(factor.BindProvider, () => factor.BindProvider);
            UserBind bind = Actor.Public.BuildEntityProcessor("SecurityApp").QueryEntity(query).FirstOrDefault();

            if (bind.IsNull())
            {
                bind = new UserBind()
                {
                    ID           = Guid.NewGuid().ToString("N"),
                    BindID       = BindID,
                    BindProvider = BindProvider
                };
            }
            bind.UserID = UserID;
            bind.UpdateEntity("SecurityApp");
        }
Exemple #2
0
 /// <summary>
 /// 查询指定角色名的角色
 /// </summary>
 /// <param name="Public"></param>
 /// <param name="RoleName"></param>
 /// <returns></returns>
 public static TeamRole[] GetRoleByName(this Public Public, string RoleName)
 {
     TeamRole factor = new TeamRole(string.Empty, RoleName);
     EntityQueryRequest<TeamRole> query = new EntityQueryRequest<TeamRole>();
     query.AppendConditionMap(factor.Name, () => factor.Name);
     return Actor.Public.BuildEntityProcessor("SecurityApp").QueryEntity(query);
 }
Exemple #3
0
        /// <summary>
        /// 查询指定角色名的角色
        /// </summary>
        /// <param name="Public"></param>
        /// <param name="RoleName"></param>
        /// <returns></returns>
        public static TeamRole[] GetRoleByName(this Public Public, string RoleName)
        {
            TeamRole factor = new TeamRole(string.Empty, RoleName);
            EntityQueryRequest <TeamRole> query = new EntityQueryRequest <TeamRole>();

            query.AppendConditionMap(factor.Name, () => factor.Name);
            return(Actor.Public.BuildEntityProcessor("SecurityApp").QueryEntity(query));
        }
Exemple #4
0
        public static TeamRole GetRole(this Public Public, string RoleID)
        {
            TeamRole factor = new TeamRole(RoleID, string.Empty);
            EntityQueryRequest <TeamRole> query = new EntityQueryRequest <TeamRole>();

            query.AppendConditionMap(factor.ID, () => factor.ID);
            return(Actor.Public.BuildEntityProcessor("SecurityApp").QueryEntity(query).FirstOrDefault());
        }
 /// <summary>
 /// 根据资源名称获得资源列表
 /// </summary>
 /// <param name="Public"></param>
 /// <param name="ResourceName"></param>
 /// <returns></returns>
 public static DroitResource[] GetResourceByName(this Public Public, String ResourceName)
 {
     DroitResource resource = new DroitResource(String.Empty)
     {
         ResourceName = ResourceName
     };
     EntityQueryRequest<DroitResource> query = new EntityQueryRequest<DroitResource>();
     query.AppendConditionMap(resource.ResourceName, () => resource.ResourceName);
     return Actor.Public.BuildEntityProcessor("SecurityApp").QueryEntity(query);
 }
        /// <summary>
        /// 根据资源名称获得资源列表
        /// </summary>
        /// <param name="Public"></param>
        /// <param name="ResourceName"></param>
        /// <returns></returns>
        public static DroitResource[] GetResourceByName(this Public Public, String ResourceName)
        {
            DroitResource resource = new DroitResource(String.Empty)
            {
                ResourceName = ResourceName
            };
            EntityQueryRequest <DroitResource> query = new EntityQueryRequest <DroitResource>();

            query.AppendConditionMap(resource.ResourceName, () => resource.ResourceName);
            return(Actor.Public.BuildEntityProcessor("SecurityApp").QueryEntity(query));
        }
Exemple #7
0
 /// <summary>
 /// 获取指定的配置模板
 /// </summary>
 /// <param name="TemplateKey"></param>
 /// <returns></returns>
 public static IConfigTemplate GetConfigTemplate(string TemplateKey)
 {
     ConfigTemplate factor = new ConfigTemplate()
     {
         TemplateKey = TemplateKey
     };
     EntityQueryRequest<ConfigTemplate> query = new EntityQueryRequest<ConfigTemplate>();
     query.AppendConditionMap(factor.TemplateKey, () => factor.TemplateKey);
     ConfigTemplate[] entities = Actor.Public.BuildEntityProcessor(ConfigTemplateSource.Name).QueryEntity(query);
     if (entities != default(ConfigTemplate[]) && entities.Length > 0)
         return entities[0];
     return default(IConfigTemplate);
 }
Exemple #8
0
        /// <summary>
        /// 获取指定的配置模板
        /// </summary>
        /// <param name="TemplateKey"></param>
        /// <returns></returns>
        public static IConfigTemplate GetConfigTemplate(string TemplateKey)
        {
            ConfigTemplate factor = new ConfigTemplate()
            {
                TemplateKey = TemplateKey
            };
            EntityQueryRequest <ConfigTemplate> query = new EntityQueryRequest <ConfigTemplate>();

            query.AppendConditionMap(factor.TemplateKey, () => factor.TemplateKey);
            ConfigTemplate[] entities = Actor.Public.BuildEntityProcessor(ConfigTemplateSource.Name).QueryEntity(query);
            if (entities != default(ConfigTemplate[]) && entities.Length > 0)
            {
                return(entities[0]);
            }
            return(default(IConfigTemplate));
        }
Exemple #9
0
 public static void BindUser(this Public Public, string UserID, string BindID, string BindProvider)
 {            
     UserBind factor = new UserBind()
     {
         BindID = BindID,
         BindProvider = BindProvider
     };
     EntityQueryRequest<UserBind> query = new EntityQueryRequest<UserBind>();
     query.AppendConditionMap(factor.BindID, () => factor.BindID);
     query.AppendConditionMap(factor.BindProvider, () => factor.BindProvider);
     UserBind bind = Actor.Public.BuildEntityProcessor("SecurityApp").QueryEntity(query).FirstOrDefault();
     if (bind.IsNull())
     {
         bind = new UserBind()
         {
             ID = Guid.NewGuid().ToString("N"),
             BindID = BindID,
             BindProvider = BindProvider
         };
     }
     bind.UserID = UserID;
     bind.UpdateEntity("SecurityApp");
 }
Exemple #10
0
 public static TeamRole GetRole(this Public Public, string RoleID)
 {
     TeamRole factor = new TeamRole(RoleID, string.Empty);
     EntityQueryRequest<TeamRole> query = new EntityQueryRequest<TeamRole>();
     query.AppendConditionMap(factor.ID, () => factor.ID);
     return Actor.Public.BuildEntityProcessor("SecurityApp").QueryEntity(query).FirstOrDefault();
 }