Skip to content
Snippets Groups Projects
Commit 9efc8893 authored by Sebastian Paul's avatar Sebastian Paul
Browse files

add permissions

parent 7c54ac58
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,10 @@ http://www.omgubuntu.co.uk/2012/07/how-to-install-ubuntus-new-web-apps-feature
-- INSTALLATION --
Install as usual, see http://drupal.org/node/70151 for further information.
1. Install as usual, see http://drupal.org/node/70151 for further information.
2. After install make shure to set permissions for users that should have access.
admin/people/permissions%23module-unity_webapp
-- CONFIGURATION --
......
......@@ -22,6 +22,9 @@ function unity_webapp_generate_links_array() {
* Insert Javascript into the page.
*/
function unity_webapp_page_alter(&$page) {
if (! user_access('access unity webapp')) {
return;
}
global $base_root;
$urlparse = parse_url($_SERVER['HTTP_HOST']);
if (isset($urlparse['host'])) {
......@@ -45,3 +48,16 @@ function unity_webapp_page_alter(&$page) {
// TODO: drupal_alter to allow other modules to alter the output.
drupal_add_js(array('unity_api' => $my_settings), 'setting');
}
/**
* Implements hook_permission().
*
*/
function unity_webapp_permission() {
return array(
'access unity webapp' => array(
'title' => t('Access unity webapp'),
'description' => t('Access unity webapp.'),
),
);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment