Commit 4014be49 authored by Zachary Doll's avatar Zachary Doll

Merge pull request #120 from hgtonight/feature/implement-badge-view-permissions

Feature/implement badge/rank view permissions
parents 946157a9 6cffb649
......@@ -91,14 +91,15 @@ class YagaController extends DashboardController {
$this->AddCssFile('style.css');
$this->MasterView = 'default';
$Module = new LeaderBoardModule();
$Module->SlotType = 'w';
$this->AddModule($Module);
$Module = new LeaderBoardModule();
$this->AddModule($Module);
$WeeklyModule = new LeaderBoardModule();
$WeeklyModule->SlotType = 'w';
$this->AddModule($WeeklyModule);
$AllTimeModule = new LeaderBoardModule();
$this->AddModule($AllTimeModule);
}
public function Ranks() {
$this->permission('Yaga.Ranks.View');
$this->FrontendStyle();
$this->AddCssFile('ranks.css');
$this->Title(T('Yaga.Ranks.All'));
......@@ -110,6 +111,7 @@ class YagaController extends DashboardController {
}
public function Badges($BadgeID = FALSE, $Slug = NULL) {
$this->permission('Yaga.Badges.View');
$this->FrontendStyle();
$this->AddCssFile('badges.css');
$this->AddModule('BadgesModule');
......@@ -129,6 +131,7 @@ class YagaController extends DashboardController {
}
public function BadgeDetail($BadgeID, $Slug = NULL) {
$this->permission('Yaga.Badges.View');
$Badge = Yaga::BadgeModel()->GetByID($BadgeID);
if(!$Badge) {
......
......@@ -26,5 +26,6 @@ $ApplicationInfo['Yaga'] = array(
'Yaga.Badges.View' => 1, // Can a user view badges?
'Yaga.Ranks.Add' => 0, // Can a user assign ranks manually?
'Yaga.Ranks.Manage' => 0, // Can a user adit/edit/delete ranks from the system?
'Yaga.Ranks.View' => 1, // Can a user view ranks?
)
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment