コード例 #1
0
ファイル: EntityCode.cs プロジェクト: vipsingh/StackAppCore
        public static EntityCode Get(string name)
        {
            EntityCode c = AllEntities[name.ToUpper()];

            c.Name = name.ToUpper();
            return(c);
        }
コード例 #2
0
        public static ActionInfo GetDetailPageLink(EntityCode entityId, int ItemId)
        {
            var q = new RequestQueryString();

            q.EntityId = entityId;
            q.ItemId   = ItemId;
            return(new ActionInfo(DETAIL_ENTITY_URL, q, "DETAIL"));
        }
コード例 #3
0
ファイル: AppContext.cs プロジェクト: vipsingh/StackAppCore
        public bool HasAccess(EntityCode entityId, AccessType type)
        {
            if (this.UserId == 1)
            {
                return(true);                  //super user
            }
            var d = EntityAccessData.Find(x => x.Get("entityid", 0) == entityId.Code && (x.Get("operation", 0) == (int)type || x.Get("operation", 0) == 0));

            if (d != null)
            {
                var op = d.Get("invoke", true);

                return(op);
            }

            return(false);
        }