-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
App::uses("SDWController", "Controller"); | ||
|
||
class CoGrouperWidgetController extends SDWController { | ||
// Class name, used by Cake | ||
public $name = "CoGrouperWidget"; | ||
|
||
public $uses = array("GrouperWidget.CoGrouperWidget", "CoGrouper"); | ||
|
||
/** | ||
* Render the widget according to the requested user and current configuration. | ||
* | ||
* @since COmanage Registry v3.2.0 | ||
* @param Integer $id CO Services Widget ID | ||
*/ | ||
|
||
public function display($id) { | ||
//TODO - need to work on this | ||
$cfg = $this->CoServicesWidget->getConfig(); | ||
|
||
// For now simply provide the services portal URL for the current CO. All necessary | ||
// logic is already attended to there. See: Views/CoServices/portal.ctp | ||
$services_url = Router::url([ | ||
'plugin' => null, | ||
'controller' => 'co_services', | ||
'action' => 'portal', | ||
'co' => $this->cur_co['Co']['id'] | ||
]); | ||
$this->set('vv_services_url', $services_url); | ||
|
||
// Pass the config so we know which div to overwrite | ||
$this->set('vv_config', $cfg); | ||
|
||
} | ||
|
||
/** | ||
* 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() { | ||
//TODO - Need to work on this | ||
|
||
$roles = $this->Role->calculateCMRoles(); | ||
|
||
// Determine what operations this user can perform | ||
|
||
// Construct the permission set for this user, which will also be passed to the view. | ||
// Ask the parent to calculate the display permission, based on the configuration. | ||
// Note that the display permission is set at the Dashboard, not Dashboard Widget level. | ||
$p = $this->calculateParentPermissions($roles); | ||
|
||
// Delete an existing CO Services Widget? | ||
$p['delete'] = ($roles['cmadmin'] || $roles['coadmin']); | ||
|
||
// Edit an existing CO Services Widget? | ||
$p['edit'] = ($roles['cmadmin'] || $roles['coadmin']); | ||
|
||
// View an existing CO Services Widget? | ||
$p['view'] = ($roles['cmadmin'] || $roles['coadmin']); | ||
|
||
$this->set('permissions', $p); | ||
return($p[$this->action]); | ||
} | ||
|
||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
App::uses('AppController', 'Controller'); | ||
|
||
class GrouperWidgetAppController extends AppController { | ||
|
||
} |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
App::uses("CoDashboardWidgetBackend", "Model"); | ||
|
||
class CoGrouperWidget extends CoDashboardWidgetBackend { | ||
// Define class name for cake | ||
public $name = "CoGrouperWidget"; | ||
|
||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
|
||
class GrouperWidget extends AppModel | ||
{ | ||
//Required Param of COmanage | ||
public $cmPluginType = "dashboardwidget"; | ||
|
||
public $name = "GrouperWidget"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
App::uses('AppModel', 'Model'); | ||
|
||
class GrouperWidgetAppModel extends AppModel { | ||
|
||
} |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.