Skip to content

Commit 2e21157

Browse files
committed
Topcoder roles added
1 parent e8d03f2 commit 2e21157

File tree

6 files changed

+1091
-16
lines changed

6 files changed

+1091
-16
lines changed

vanilla/applications/dashboard/models/class.permissionmodel.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ public function assignDefaults($resetDefaults = false) {
190190
]
191191
);
192192

193+
$this->addDefault(
194+
RoleModel::TYPE_TOPCODER,
195+
[
196+
'Garden.SignIn.Allow' => 1,
197+
]
198+
);
199+
193200
// Allow the ability for other applications and plug-ins to speak up with their own default permissions.
194201
$this->fireEvent('DefaultPermissions');
195202
}
@@ -1468,4 +1475,6 @@ public function getNamespaces() {
14681475
$namespaces = $this->namespaces;
14691476
return $namespaces;
14701477
}
1478+
1479+
14711480
}

vanilla/applications/dashboard/models/class.rolemodel.php

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,53 @@ class RoleModel extends Gdn_Model {
3131
/** Slug for Administrator role type. */
3232
const TYPE_ADMINISTRATOR = 'administrator';
3333

34+
/** Slug for Topcoder role type. */
35+
const TYPE_TOPCODER = 'topcoder';
36+
37+
const ROLE_TYPE_TOPCODER = 'topcoder';
38+
const ROLE_TOPCODER_ADMINISTRATOR = 'administrator';
39+
const ROLE_TOPCODER_CONNECT_ADMIN = 'Connect Admin';
40+
41+
const TOPCODER_ROLES = [
42+
'administrator' => [
43+
// all permissions
44+
],
45+
'Connect Manager' => [],
46+
'Connect Account Manager' => [],
47+
'Connect Copilot' => [
48+
'Name' => ROLE_TOPCODER_CONNECT_COPILOT,
49+
'Type' => ROLE_TYPE_TOPCODER,
50+
'Garden.Uploads.Add' => 1
51+
],
52+
'Connect Admin' => [
53+
// all permissions
54+
],
55+
'Connect Copilot Manager' => [],
56+
'Business Development Representative' => [],
57+
'Presales' => [],
58+
'Account Executive' => [],
59+
'Program Manager' => [],
60+
'Solution Architect'=> [],
61+
'Project Manager'=> [],
62+
'Topcoder User' => []
63+
];
64+
65+
const TOPCODER_PROJECT_ROLES = [
66+
'manager' => [],
67+
'copilot' => [
68+
'Name' => ROLE_TOPCODER_PROJECT_COPILOT,
69+
'Type' => ROLE_TYPE_TOPCODER,
70+
'Garden.Uploads.Add' => 1
71+
],
72+
'customer' => [],
73+
'observer'=> [],
74+
'account_manager'=> [],
75+
'program_manager'=> [],
76+
'account_executive'=> [],
77+
'solution_architect'=> [],
78+
'project_manager' => []
79+
];
80+
3481
/** @var array|null All roles. */
3582
public static $Roles = null;
3683

@@ -304,7 +351,8 @@ public static function getDefaultTypes($translate = true) {
304351
self::TYPE_UNCONFIRMED => self::TYPE_UNCONFIRMED,
305352
self::TYPE_APPLICANT => self::TYPE_APPLICANT,
306353
self::TYPE_MODERATOR => self::TYPE_MODERATOR,
307-
self::TYPE_ADMINISTRATOR => self::TYPE_ADMINISTRATOR
354+
self::TYPE_ADMINISTRATOR => self::TYPE_ADMINISTRATOR,
355+
self::TYPE_TOPCODER => self::TYPE_TOPCODER
308356
];
309357
if ($translate) {
310358
$result = array_map('t', $result);

0 commit comments

Comments
 (0)