Skip to content
Snippets Groups Projects
Commit a266f138 authored by William Turner's avatar William Turner
Browse files

Starts adding a mapping widget for settings.

parent b25df027
Branches
Tags
No related merge requests found
// @flow
import React, { Component, PropTypes } from "react";
import Button from "metabase/components/Button";
// import Modal from "metabase/components/Modal.jsx";
type Props = {
updateSetting: (value: boolean) => void,
setting: {}
};
export default class LdapGroupMappingsWidget extends Component<*, Props, *> {
props: Props;
render() {
return <Button className="ml1" primary medium>Edit Mappings</Button>;
}
}
......@@ -12,6 +12,7 @@ import {
} from "./components/widgets/PublicLinksListing.jsx";
import SecretKeyWidget from "./components/widgets/SecretKeyWidget.jsx";
import EmbeddingLegalese from "./components/widgets/EmbeddingLegalese";
import LdapGroupMappingsWidget from "./components/widgets/LdapGroupMappingsWidget";
import { UtilApi } from "metabase/services";
......@@ -238,11 +239,6 @@ const SECTIONS = [
display_name: "Group search base",
type: "string",
required: true
},
{
key: "ldap-group-mappings",
display_name: "Group mappings",
type: "string"
}
]
},
......
......@@ -3,6 +3,7 @@
[clojure.string :as s]
(toucan [db :as db]
[models :as models])
[metabase.integrations.ldap :as ldap]
[metabase.util :as u]))
(models/defmodel PermissionsGroup :permissions_group)
......@@ -70,7 +71,11 @@
(check-not-magic-group group)
(db/delete! 'Permissions :group_id id)
(db/delete! 'PermissionsGroupMembership :group_id id)
(db/delete! 'PermissionsGroupLdapMapping :group_id id))
;; Remove from LDAP mappings
(ldap/ldap-group-mappings
(zipmap (keys (ldap/ldap-group-mappings))
(for [val (vals (ldap/ldap-group-mappings))]
(remove (partial = id) val)))))
(defn- pre-update [{group-name :name, :as group}]
(u/prog1 group
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment