Esempio n. 1
0
        public override ICollection <PersmissionsTypes> GetPermissions(string storeName)
        {
            if (permmisions == null || permmisions.next == null)
            {
                return(null);
            }
            ICollection <PersmissionsTypes> ans = new List <PersmissionsTypes>();
            aPermission corrent = permmisions;

            while (corrent.next != null)
            {
                corrent = corrent.next;
                if (corrent.store.Equals(storeName))
                {
                    ans.Add(corrent.who());
                }
            }
            return(ans);
        }
Esempio n. 2
0
        public override Dictionary <string, ICollection <string> > GetAllPermissions()
        {
            aPermission corrent    = permmisions;
            string      storeName  = "";
            bool        first      = true;
            bool        firstfirst = true;
            Dictionary <string, ICollection <string> > ans = new Dictionary <string, ICollection <string> >();
            ICollection <string> list = new List <string>();

            if (corrent == null)
            {
                return(null);
            }
            while (corrent.next != null)
            {
                //if (corrent.store.Equals(""))
                //storeName = corrent.store;
                corrent = corrent.next;
                if (firstfirst)
                {
                    storeName  = corrent.store;
                    firstfirst = false;
                }
                if (!(storeName.Equals(corrent.store)))
                {
                    if (first)
                    {
                        ans[storeName] = list;
                        first          = false;
                        storeName      = corrent.store;
                    }
                    list = new List <string>();
                }
                list.Add(aPermission.who(corrent.who()));
            }
            ans[storeName] = list;
            return(ans);
        }