Skip to content

Commit

Permalink
Merge pull request #491 from pencilblue/0.4.0-blake
Browse files Browse the repository at this point in the history
0.4.0 blake
  • Loading branch information
brianhyder committed Mar 13, 2015
2 parents 5b5fa60 + 0b6e485 commit 0d91d8e
Show file tree
Hide file tree
Showing 24 changed files with 309 additions and 193 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
[PencilBlue](http://pencilblue.org)
=====

### Full featured online publishing and CMS for Node.js

#### [v0.3.0 Now Available](https://pencilblue.org/article/pencilblue-0-3-0-available-141124)
### A full featured Node.js CMS and blogging platform (plugins, server cluster management, data-driven pages)

First and foremost: If at any point you have questions, comments or concerns you can find us hanging out on twitter [@getpencilblue](https://twitter.com/GetPencilBlue) and on our [subreddit](http://www.reddit.com/domain/pencilblue.org/). We're always happy to help and pull requests (plugin or core) are always welcome.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pencilblue",
"version": "0.2.2",
"description": "Full stack online publishing and CMS for Node.js",
"description": "A full featured Node.js CMS and blogging platform (plugins, server cluster management, data-driven pages)",
"authors": [
{
"name": "PencilBlue, LLC",
Expand Down
40 changes: 21 additions & 19 deletions include/access_management.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = function(pb) {
* @type {Integer}
*/
SecurityService.ACCESS_USER = 0;

/**
*
* @static
Expand All @@ -48,7 +48,7 @@ module.exports = function(pb) {
* @type {Integer}
*/
SecurityService.ACCESS_WRITER = 1;

/**
*
* @static
Expand All @@ -57,7 +57,7 @@ module.exports = function(pb) {
* @type {Integer}
*/
SecurityService.ACCESS_EDITOR = 2;

/**
*
* @static
Expand All @@ -66,7 +66,7 @@ module.exports = function(pb) {
* @type {Integer}
*/
SecurityService.ACCESS_MANAGING_EDITOR = 3;

/**
*
* @static
Expand Down Expand Up @@ -100,7 +100,7 @@ module.exports = function(pb) {
ROLE_VAL_TO_NAME[SecurityService.ACCESS_EDITOR] = 'ACCESS_EDITOR';
ROLE_VAL_TO_NAME[SecurityService.ACCESS_MANAGING_EDITOR] = 'ACCESS_MANAGING_EDITOR';
ROLE_VAL_TO_NAME[SecurityService.ACCESS_ADMINISTRATOR] = 'ACCESS_ADMINISTRATOR';

/**
*
* @static
Expand All @@ -109,7 +109,7 @@ module.exports = function(pb) {
* @type {Integer}
*/
SecurityService.AUTHENTICATED = 'authenticated';

/**
*
* @static
Expand All @@ -120,34 +120,36 @@ module.exports = function(pb) {
SecurityService.ADMIN_LEVEL = 'admin_level';

/**
* Retrieves the localized names of access levels
* Retrieves the localized names of access levels as an array
*
* @method getRoleNames
* @param {Object} ls The localization service
* @param {Localization} ls The localization service
* @return {Array}
*/
SecurityService.getRoleNames = function(ls) {
var map = SecurityService.getRoleToDisplayNameMap(ls);
return util.hashToArray(map);
};

/**
*
* Provides a hash of the default roles to their translated display name
* @static
* @method getRoleToDisplayNameMap
* @param {Localization} ls
* @return {Object}
*/
SecurityService.getRoleToDisplayNameMap = function(ls) {
if (util.isFunction(ls)) {
return {
'ACCESS_USER': ls.get('ACCESS_USER'),
'ACCESS_WRITER': ls.get('ACCESS_WRITER'),
'ACCESS_EDITOR': ls.get('ACCESS_EDITOR'),
'ACCESS_MANAGING_EDITOR': ls.get('ACCESS_MANAGING_EDITOR'),
'ACCESS_ADMINISTRATOR': ls.get('ACCESS_ADMINISTRATOR'),
};
if (util.isNullOrUndefined(ls)) {
throw new Error('The localization parameter cannot be null');
}
return null;

return {
'ACCESS_USER': ls.get('ACCESS_USER'),
'ACCESS_WRITER': ls.get('ACCESS_WRITER'),
'ACCESS_EDITOR': ls.get('ACCESS_EDITOR'),
'ACCESS_MANAGING_EDITOR': ls.get('ACCESS_MANAGING_EDITOR'),
'ACCESS_ADMINISTRATOR': ls.get('ACCESS_ADMINISTRATOR'),
};
};

/**
Expand Down Expand Up @@ -268,6 +270,6 @@ module.exports = function(pb) {
}
return password.join('');
};

return SecurityService;
};
51 changes: 39 additions & 12 deletions include/admin_navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
var util = require('./util.js');

module.exports = function AdminNavigationModule(pb) {

//PB dependencies
var SecurityService = pb.SecurityService;

Expand All @@ -42,7 +42,7 @@ module.exports = function AdminNavigationModule(pb) {
* @type {Array}
*/
AdminNavigation.additions = [];

/**
*
* @private
Expand All @@ -51,7 +51,7 @@ module.exports = function AdminNavigationModule(pb) {
* @type {Object}
*/
AdminNavigation.childrenAdditions = {};

/**
*
* @private
Expand Down Expand Up @@ -179,14 +179,41 @@ module.exports = function AdminNavigationModule(pb) {
access: SecurityService.ACCESS_MANAGING_EDITOR
},
{
divider: true,
id: 'logout',
title: 'LOGOUT',
icon: 'power-off',
href: '/actions/logout',
access: SecurityService.ACCESS_WRITER
id: 'content_settings',
title: 'CONTENT',
icon: 'quote-right',
href: '/admin/site_settings/content',
access: SecurityService.ACCESS_MANAGING_EDITOR
},
{
id: 'email_settings',
title: 'EMAIL',
icon: 'envelope',
href: '/admin/site_settings/email',
access: SecurityService.ACCESS_MANAGING_EDITOR
},
{
id: 'library_settings',
title: 'LIBRARIES',
icon: 'book',
href: '/admin/site_settings/libraries',
access: SecurityService.ACCESS_MANAGING_EDITOR
}
]
},
{
id: 'view_site',
title: 'VIEW_SITE',
icon: 'desktop',
href: '/',
access: SecurityService.ACCESS_WRITER
},
{
id: 'logout',
title: 'LOGOUT',
icon: 'power-off',
href: '/actions/logout',
access: SecurityService.ACCESS_WRITER
}
]);

Expand Down Expand Up @@ -245,12 +272,12 @@ module.exports = function AdminNavigationModule(pb) {
if (ids.length === 0) {
return navigation;
}

//convert to hash to create quick lookup
var lookup = util.arrayToHash(navigation, function(navigation, i) {
return navigation[i].id;
});

//add additions
Object.keys(childrenAdditions).forEach(function(id) {
var children = childrenAdditions[id];
Expand All @@ -260,7 +287,7 @@ module.exports = function AdminNavigationModule(pb) {
if (!nav) {
return;
}


if (!util.isArray(nav.children)) {
navigation[i].children = [];
Expand Down
Loading

0 comments on commit 0d91d8e

Please sign in to comment.