예제 #1
0
        public void AddTo(CodeGen code_gen, PEAPI.MetaDataElement elem)
        {
            System.Text.UnicodeEncoding ue = new System.Text.UnicodeEncoding();
            foreach (DictionaryEntry entry in permissionset_table)
            {
                PEAPI.SecurityAction sec_action = (PEAPI.SecurityAction)entry.Key;
                SSPermissionSet      ps         = (SSPermissionSet)entry.Value;

                code_gen.PEFile.AddDeclSecurity(sec_action,
                                                ue.GetBytes(ps.ToXml().ToString()),
                                                elem);
            }

            if (permissionset20_table == null)
            {
                return;
            }

            foreach (DictionaryEntry entry in permissionset20_table)
            {
                PEAPI.SecurityAction sec_action = (PEAPI.SecurityAction)entry.Key;
                MIPermissionSet      ps         = (MIPermissionSet)entry.Value;

                code_gen.PEFile.AddDeclSecurity(sec_action,
                                                ps.Resolve(code_gen),
                                                elem);
            }
        }
예제 #2
0
        public void AddPermission(PEAPI.SecurityAction sec_action, IPermission perm)
        {
            SSPermissionSet ps = (SSPermissionSet)permissionset_table [sec_action];

            if (ps == null)
            {
                ps = new SSPermissionSet(PermissionState.None);
                permissionset_table [sec_action] = ps;
            }

            ps.AddPermission(perm);
        }
예제 #3
0
        public void AddPermissionSet(PEAPI.SecurityAction sec_action, SSPermissionSet perm_set)
        {
            SSPermissionSet ps = (SSPermissionSet)permissionset_table [sec_action];

            if (ps == null)
            {
                permissionset_table [sec_action] = perm_set;
                return;
            }

            foreach (IPermission iper in perm_set)
            {
                ps.AddPermission(iper);
            }
        }
예제 #4
0
        //Not called by parser for profile != NET_2_0
        public void AddPermissionSet(PEAPI.SecurityAction sec_action, MIPermissionSet perm_set)
        {
            PermissionSet ps = null;

            if (permissionset20_table == null)
            {
                permissionset20_table = new Hashtable();
            }
            else
            {
                ps = (MIPermissionSet)permissionset20_table [sec_action];
            }

            if (ps == null)
            {
                permissionset20_table [sec_action] = perm_set;
                return;
            }

            foreach (Permission perm in perm_set.Permissions)
            {
                ps.AddPermission(perm);
            }
        }
예제 #5
0
		public PermissionSet (PEAPI.SecurityAction sec_action)
		{
			this.sec_action = sec_action;
		}
예제 #6
0
 public PermissionSet (PEAPI.SecurityAction sec_action, ArrayList permissions)
 {
         this.sec_action = sec_action;
         this.permissions = permissions;
 }
 public PermissionSet(PEAPI.SecurityAction sec_action, ArrayList permissions)
 {
     this.sec_action  = sec_action;
     this.permissions = permissions;
 }