2017-11-14 17:09:13 +01:00
|
|
|
import request from 'utils/request';
|
2017-11-14 16:05:06 +01:00
|
|
|
// This method is executed before the load of the plugin
|
2017-11-14 17:09:13 +01:00
|
|
|
const bootstrap = (plugin) => new Promise((resolve, reject) => {
|
2017-11-16 15:51:12 +01:00
|
|
|
request('/users-permissions/init')
|
2017-11-14 17:09:13 +01:00
|
|
|
.then(response => {
|
|
|
|
plugin.hasAdminUser = response.hasAdmin;
|
|
|
|
plugin.nonProtectedUrl = '/plugins/users-permissions/auth';
|
|
|
|
|
2017-11-27 12:22:20 +01:00
|
|
|
// Add Users to Content Types section.
|
|
|
|
plugin.leftMenuSections.push({
|
|
|
|
links: [{
|
|
|
|
label: 'Users',
|
|
|
|
destination: 'user',
|
|
|
|
plugin: 'content-manager'
|
|
|
|
}],
|
|
|
|
name: 'Content Types'
|
|
|
|
});
|
|
|
|
|
2017-11-14 17:09:13 +01:00
|
|
|
return resolve(plugin);
|
|
|
|
})
|
|
|
|
.catch(err => reject(err));
|
2017-11-14 16:05:06 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export default bootstrap;
|