我不小心执行了以下组织政策:
module "allowed_policy_member_domains_org_policy" {
source = "terraform-google-modules/org-policy/google"
policy_for = "organization"
constraint = "constraints/iam.allowedPolicyMemberDomains"
policy_type = "list"
organization_id = data.google_organization.org.org_id
allow = var.allowed_policy_member_domains
enforce = true
}
我不小心包括了强制文件,似乎使我无法执行组织策略。我是帐户的所有者,但是当我进入组织政策页面时,“编辑”按钮显示为灰色。
我去尝试向任何人添加任何角色,但现在我做不到:
请帮助!
答案 0 :(得分:1)
想通了!
import React, { useState, useEffect } from "react";
const App = () => {
const [text, setText] = useState("");
const [list, setList] = useState([]);
const addToList = () => {
if (text !== "") {
setList([...list, text]);
setText("");
}
};
const deleteItem = (index) => {
const deletedList = list.filter((_, i) => i !== index);
setList(deletedList);
};
const listener = (e) => {
e.stopPropagation();
if (e.key === "Enter") {
console.log("event triggered");
if (text !== "") {
console.log("updating");
setList((a) => [...a, text]);
}
setText("");
return "";
}
};
// not needed, only here to show it only runs once
useEffect(() => {
console.log("Reloaded");
}, []);
return (
<div>
<input
type="text"
id="textbox"
onChange={(e) => setText(e.target.value)}
onKeyPress={listener}
value={text}
/>
<button id="add" onClick={addToList}>
{" "}
Add
</button>
<ul>
{list.map((a, i) => (
<li key={i}>
{a}{" "}
<button type="button" onClick={() => deleteItem(i)}>
Delete
</button>
</li>
))}
</ul>
</div>
);
};
export default App;
应该工作!