Exemple #1
0
 public ace(ace a)
 {
     deny   = a.deny;
     rights = a.rights;
     _id    = a._id;
     name   = a.name;
 }
Exemple #2
0
        public void AddRight(string _id, string name, ace_right[] rights)
        {
            if (_acl == null)
            {
                _acl = new ace[] { }
            }
            ;
            var ace = _acl.Where(x => x._id == _id).FirstOrDefault();

            if (ace == null)
            {
                ace = new ace(); _acl = _acl.Concat(new ace[] { ace }).ToArray(); ace._id = _id; ace.name = name;
            }
            if (rights != null && rights.Length > 0)
            {
                for (var bit = 0; bit < 10; bit++)
                {
                    ace.unsetBit((bit + 1));
                }
                foreach (ace_right bit in rights)
                {
                    ace.setBit((decimal)bit);
                }
            }
        }
    }
Exemple #3
0
        public void AddRight(string _id, string name, ace_right[] rights)
        {
            if (_acl == null)
            {
                _acl = new ace[] { }
            }
            ;
            var ace = _acl.Where(x => x._id == _id).FirstOrDefault();

            if (ace == null)
            {
                ace = new ace(); _acl = _acl.Concat(new ace[] { ace }).ToArray(); ace._id = _id; ace.name = name;
            }
            if (rights != null && rights.Length > 0)
            {
                for (var bit = 0; bit < 10; bit++)
                {
                    ace.unsetBit((bit + 1));
                }
                foreach (ace_right bit in rights)
                {
                    ace.setBit((decimal)bit);
                }
            }
        }

        //public void delete()
        //{
        //    rpaactivities.socketService.instance.DELETE(_id, "workflows");
        //}
        //public void save()
        //{
        //    if (string.IsNullOrEmpty(_id))
        //    {
        //        var result = rpaactivities.socketService.instance.POST(this, "workflows");
        //        if (result != null)
        //        {
        //            _id = result._id;
        //            _type = result._type;
        //            _modified = result._modified;
        //            _modifiedby = result._modifiedby;
        //            _modifiedbyid = result._modifiedbyid;
        //            _created = result._created;
        //            _createdby = result._createdby;
        //            _createdbyid = result._createdbyid;
        //        }
        //    }
        //    else
        //    {
        //        var result = rpaactivities.socketService.instance.PUT(this, "workflows");
        //        if (result != null)
        //        {
        //            _modified = result._modified;
        //            _modifiedby = result._modifiedby;
        //            _modifiedbyid = result._modifiedbyid;
        //        }
        //    }
        //}
    }