/// <summary> /// Removes a specific permission for the given grantee. /// </summary> /// <param name="grantee">The grantee</param> /// <param name="permission">The permission for the grantee to remove</param> public void RemoveGrant(S3Grantee grantee, S3Permission permission) { foreach (S3Grant grant in Grants) { if (grant.Grantee.Equals(grantee) && grant.Permission == permission) { Grants.Remove(grant); break; } } }
public void RemoveGrant(S3Grantee grantee) { List <S3Grant> list = new List <S3Grant>(); foreach (S3Grant grant in Grants) { if (grant.Grantee.Equals(grantee)) { list.Add(grant); } } foreach (S3Grant item in list) { Grants.Remove(item); } }