mirror of
https://github.com/vale981/Vulcan
synced 2025-03-11 13:06:41 -04:00
27 lines
671 B
JavaScript
27 lines
671 B
JavaScript
/**
|
|
* @Author: Apollinaire Lecocq <apollinaire>
|
|
* @Date: 08-01-19
|
|
* @Last modified by: apollinaire
|
|
* @Last modified time: 10-01-19
|
|
*/
|
|
import React from 'react';
|
|
import {registerComponent, Components, withAccess, Dummy} from 'meteor/vulcan:core';
|
|
|
|
const RestrictToAdmins = withAccess({groups: ['admins']})(Dummy);
|
|
|
|
/**
|
|
* A simple component that renders the existing layout and checks wether the currentUser is an admin or not.
|
|
*/
|
|
|
|
function AdminLayout({children}) {
|
|
return (
|
|
<Components.Layout>
|
|
<RestrictToAdmins>{children}</RestrictToAdmins>
|
|
</Components.Layout>
|
|
);
|
|
}
|
|
|
|
registerComponent({
|
|
name: 'AdminLayout',
|
|
component: AdminLayout,
|
|
});
|