Skip to content

Commit

Permalink
ACLs: add deprecation banner (#8057)
Browse files Browse the repository at this point in the history
* ACLs: add deprecation banner

* CR Fixes
  • Loading branch information
N-o-Z authored Aug 6, 2024
1 parent 43fc019 commit 01cc109
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions webui/src/lib/components/auth/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Col from "react-bootstrap/Col";
import Nav from "react-bootstrap/Nav";
import Card from "react-bootstrap/Card";

import {auth} from "../../api";
import {Link} from "../nav";
import {useLoginConfigContext} from "../../hooks/conf";
import {useLayoutOutletContext} from "../layout";
Expand All @@ -14,7 +15,6 @@ import {InfoIcon} from "@primer/octicons-react";

type AuthOutletContext = [(tab: string) => void];


const rbacDismissedKey = "lakefs:ui:acl:dismissRBACAlert";
export const AuthLayout = () => {
const [showRBACAlert, setShowRBACAlert] = useState(!window.localStorage.getItem(rbacDismissedKey));
Expand All @@ -24,12 +24,23 @@ export const AuthLayout = () => {
useEffect(() => {
setIsLogged(true);
}, [setIsLogged]);
const [displayACLDeprecation, setDisplayACLDeprecation] = useState(false);
useEffect(() => {
const listUsers = async () => {
return await auth.listUsers("", "", 2);
}
listUsers().then(r => setDisplayACLDeprecation(r.results.length > 1));
},[])
return (
<Container fluid="xl">
<Row className="mt-5">
<div>
{ displayACLDeprecation &&
<Alert variant="warning" title="ACL Deprecation"><InfoIcon/>{" "}<b>ACLs are moving out of core lakeFS!</b>{" "}See the <Alert.Link href={"https://lakefs.io/blog/why-moving-acls-out-of-core-lakefs/"}>announcement</Alert.Link>{" "}
to learn why and how to continue using your existing lakeFS installation in future versions.</Alert>
}
{rbac === 'simplified' && showRBACAlert &&
<Alert severity="info" title="rbac CTA" dismissible onClose={() => {
<Alert variant="info" title="rbac CTA" dismissible onClose={() => {
window.localStorage.setItem(rbacDismissedKey, "true");
setShowRBACAlert(false);
}}><InfoIcon/>{" "}Enhance Your Security with {" "}<Alert.Link href={"https://docs.lakefs.io/reference/security/rbac.html"}>Role-Based Access Control</Alert.Link>{" "}
Expand Down

0 comments on commit 01cc109

Please sign in to comment.