Vulcan/packages/vulcan-admin/lib/components/AdminLayout.jsx

28 lines
672 B
React
Raw Permalink Normal View History

2019-01-08 16:22:14 +01:00
/**
* @Author: Apollinaire Lecocq <apollinaire>
* @Date: 08-01-19
* @Last modified by: apollinaire
* @Last modified time: 10-01-19
2019-01-08 16:22:14 +01:00
*/
import React from 'react';
import {registerComponent, Components, withAccess, Dummy} from 'meteor/vulcan:core';
2019-01-09 11:29:25 +01:00
const RestrictToAdmins = withAccess({groups: ['admins']})(Dummy);
2019-01-08 16:22:14 +01:00
/**
2019-02-17 15:04:05 +02:00
* A simple component that renders the existing layout and checks whether the currentUser is an admin or not.
2019-01-08 16:22:14 +01:00
*/
2019-01-09 11:29:25 +01:00
function AdminLayout({children}) {
return (
<Components.Layout>
<RestrictToAdmins>{children}</RestrictToAdmins>
</Components.Layout>
);
2019-01-08 16:22:14 +01:00
}
registerComponent({
name: 'AdminLayout',
component: AdminLayout,
});