Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added db schema for dashboard widget
rmathis committed Dec 17, 2020
1 parent aceb8d0 commit cb2e7d0
Showing 5 changed files with 669 additions and 4 deletions.
44 changes: 44 additions & 0 deletions Config/Schema/schema.xml
@@ -0,0 +1,44 @@
<?xml version="1.0" ?>
<!--
COmanage Registry Notification Widget Plugin Database Schema
Portions licensed to the University Corporation for Advanced Internet
Development, Inc. ("UCAID") under one or more contributor license agreements.
See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
UCAID licenses this file to you under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with the
License. You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
While this schema mostly works with database prefixes, foreign key constraints
must be specified in raw SQL, which needs the prefixed table name.
-->
<schema version="0.3">
<table name="co_grouper_lites">
<field name="id" type="I">
<key />
<autoincrement />
</field>
<field name="co_dashboard_widget_id" type="I">
<constraint>REFERENCES cm_co_dashboard_widgets(id)</constraint>
</field>
<field name="created" type="T" />
<field name="modified" type="T" />

<index name="co_grouper_lites_i1">
<col>co_dashboard_widget_id</col>
<unique />
</index>
</table>
</schema>
18 changes: 17 additions & 1 deletion Controller/CoGrouperLitesController.php
@@ -7,6 +7,22 @@ class CoGrouperLitesController extends SDWController {
// Class name, used by Cake
public $name = "CoGrouperLites";

//TODO - need to add the call $this->calculateParentPermissions($roles); for authorization
public function display($id)
{
echo 'hi there';
}

/**
* Authorization for this Controller, called by Auth component
* - precondition: Session.Auth holds data used for authz decisions
* - postcondition: $permissions set with calculated permissions
*
* @since COmanage Registry v3.2.0
* @return Array Permissions
*/

function isAuthorized()
{
return (true);
}
}
5 changes: 4 additions & 1 deletion Model/CoGrouperLite.php
@@ -6,6 +6,9 @@ class CoGrouperLite extends CoDashboardWidgetBackend {
// Define class name for cake
public $name = "CoGrouperLite";


// Association rules from this model to other models
public $belongsTo = array(
"CoDashboardWidget"
);

}
4 changes: 2 additions & 2 deletions View/GrouperGroups/fields.inc
@@ -19,7 +19,7 @@ $PRIVELAGES = array('READ', 'VIEW', 'OPTIN', 'OPTOUT', 'ATTRIBUTE_READ');
queryTokenizer: Bloodhound.tokenizers.whitespace,
// url points to a json file that contains an array of country names, see
// https://github.com/twitter/typeahead.js/blob/gh-pages/data/countries.json
remote: '/files/users.json',
remote: '/registry/grouper_lite/files/users.json',
identify: function(obj) {
return obj.email;
}
@@ -73,7 +73,7 @@ $PRIVELAGES = array('READ', 'VIEW', 'OPTIN', 'OPTOUT', 'ATTRIBUTE_READ');
var button = [
'<button class="btn btn-text btn-icon ml-2 typeahead-remove" type="button" data-subscriber="' + s.email + '">',
'<span class="sr-only">',
<?php echo _txt('pl.grouperlite.action.remove') ?>,
'<?php echo _txt('pl.grouperlite.action.remove') ?>',
'</span>',
'<i class="fa fa-times"></i>',
'</button>'
602 changes: 602 additions & 0 deletions webroot/files/users.json

Large diffs are not rendered by default.

0 comments on commit cb2e7d0

Please sign in to comment.