Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions lbplanner/classes/enums/CAPABILITY.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@
* Capabilities a user can have
*/
class CAPABILITY extends Enum {
/**
* Shortname of the admin CAPABILITY.
*/
const ADMIN = 'local/lb_planner:admin';

/**
* Shortname of the manager CAPABILITY.
*/
const MANAGER = 'local/lb_planner:manager';

/**
* Shortname of the teacher CAPABILITY.
*/
Expand Down
10 changes: 0 additions & 10 deletions lbplanner/classes/enums/CAPABILITY_FLAG.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@
* Bitmappable flags for capabilities a user can have
*/
class CAPABILITY_FLAG extends Enum {
/**
* Flag of the admin CAPABILITY.
*/
const ADMIN = 1;

/**
* Flag of the manager CAPABILITY.
*/
const MANAGER = 2;

/**
* Flag of the teacher CAPABILITY.
*/
Expand Down
3 changes: 1 addition & 2 deletions lbplanner/classes/helpers/slot_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,7 @@ public static function check_slot_supervisor(int $supervisorid, int $slotid): bo

$context = context_system::instance();
if (
has_capability(CAPABILITY::ADMIN, $context, $supervisorid)
|| has_capability(CAPABILITY::SLOTMASTER, $context, $supervisorid)
has_capability(CAPABILITY::SLOTMASTER, $context, $supervisorid)
) {
return true;
}
Expand Down
17 changes: 8 additions & 9 deletions lbplanner/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,18 @@
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
],
'local/lb_planner:admin' => [
'local/lb_planner:slotmaster' => [
'riskbitmask' => RISK_SPAM || RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
],
'local/lb_planner:manager' => [
'riskbitmask' => RISK_SPAM || RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
];

$deprecatedcapabilities = [
'local/lb_planner:admin' => [
'message' => 'this capability was removed because of internal changes making it unnecessary',
],
'local/lb_planner:slotmaster' => [
'riskbitmask' => RISK_SPAM || RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'local/lb_planner:manager' => [
'message' => 'this capability was removed because of internal changes making it unnecessary',
],
];
Loading