Add proper permissions to admin role

This commit is contained in:
Brian Miyaji
2014-01-22 05:05:23 +11:00
parent 16677ff2a5
commit 86b06e3ec6
5 changed files with 83 additions and 35 deletions

View File

@@ -4,58 +4,102 @@ function sportspress_activation_hook() {
$role = get_role( 'administrator' );
// Events
$role->add_cap( 'edit_sp_event' );
$role->add_cap( 'edit_sp_events' );
$role->add_cap( 'edit_others_sp_events' );
$role->add_cap( 'delete_sp_event' );
$role->add_cap( 'publish_sp_events' );
$role->add_cap( 'read_sp_events' );
$role->add_cap( 'read_private_sp_events' );
$role->add_cap( 'edit_sp_event' );
$role->add_cap( 'edit_sp_events' );
$role->add_cap( 'edit_published_sp_events' );
$role->add_cap( 'edit_private_sp_events' );
$role->add_cap( 'edit_others_sp_events' );
$role->add_cap( 'delete_sp_event' );
$role->add_cap( 'delete_published_sp_events' );
$role->add_cap( 'delete_private_sp_events' );
$role->add_cap( 'delete_others_sp_events' );
$role->add_cap( 'publish_sp_events' );
// Calendars
$role->add_cap( 'read_sp_calendars' );
$role->add_cap( 'read_private_sp_calendars' );
$role->add_cap( 'edit_sp_calendar' );
$role->add_cap( 'edit_sp_calendars' );
$role->add_cap( 'edit_published_sp_calendars' );
$role->add_cap( 'edit_private_sp_calendars' );
$role->add_cap( 'edit_others_sp_calendars' );
$role->add_cap( 'delete_sp_calendar' );
$role->add_cap( 'delete_published_sp_calendars' );
$role->add_cap( 'delete_private_sp_calendars' );
$role->add_cap( 'delete_others_sp_calendars' );
$role->add_cap( 'publish_sp_calendars' );
// Teams
$role->add_cap( 'edit_sp_team' );
$role->add_cap( 'edit_sp_teams' );
$role->add_cap( 'edit_others_sp_teams' );
$role->add_cap( 'delete_sp_team' );
$role->add_cap( 'publish_sp_teams' );
$role->add_cap( 'read_sp_teams' );
$role->add_cap( 'read_private_sp_teams' );
$role->add_cap( 'edit_sp_team' );
$role->add_cap( 'edit_sp_teams' );
$role->add_cap( 'edit_published_sp_teams' );
$role->add_cap( 'edit_private_sp_teams' );
$role->add_cap( 'edit_others_sp_teams' );
$role->add_cap( 'delete_sp_team' );
$role->add_cap( 'delete_published_sp_teams' );
$role->add_cap( 'delete_private_sp_teams' );
$role->add_cap( 'delete_others_sp_teams' );
$role->add_cap( 'publish_sp_teams' );
// League Tables
$role->add_cap( 'edit_sp_table' );
$role->add_cap( 'edit_sp_tables' );
$role->add_cap( 'edit_others_sp_tables' );
$role->add_cap( 'delete_sp_table' );
$role->add_cap( 'publish_sp_tables' );
$role->add_cap( 'read_sp_tables' );
$role->add_cap( 'read_private_sp_tables' );
$role->add_cap( 'edit_sp_table' );
$role->add_cap( 'edit_sp_tables' );
$role->add_cap( 'edit_published_sp_tables' );
$role->add_cap( 'edit_private_sp_tables' );
$role->add_cap( 'edit_others_sp_tables' );
$role->add_cap( 'delete_sp_table' );
$role->add_cap( 'delete_published_sp_tables' );
$role->add_cap( 'delete_private_sp_tables' );
$role->add_cap( 'delete_others_sp_tables' );
$role->add_cap( 'publish_sp_tables' );
// Players
$role->add_cap( 'edit_sp_player' );
$role->add_cap( 'edit_sp_players' );
$role->add_cap( 'edit_others_sp_players' );
$role->add_cap( 'delete_sp_player' );
$role->add_cap( 'publish_sp_players' );
$role->add_cap( 'read_sp_players' );
$role->add_cap( 'read_private_sp_players' );
$role->add_cap( 'edit_sp_player' );
$role->add_cap( 'edit_sp_players' );
$role->add_cap( 'edit_published_sp_players' );
$role->add_cap( 'edit_private_sp_players' );
$role->add_cap( 'edit_others_sp_players' );
$role->add_cap( 'delete_sp_player' );
$role->add_cap( 'delete_published_sp_players' );
$role->add_cap( 'delete_private_sp_players' );
$role->add_cap( 'delete_others_sp_players' );
$role->add_cap( 'publish_sp_players' );
// Player Lists
$role->add_cap( 'edit_sp_list' );
$role->add_cap( 'edit_sp_lists' );
$role->add_cap( 'edit_others_sp_lists' );
$role->add_cap( 'delete_sp_list' );
$role->add_cap( 'publish_sp_lists' );
$role->add_cap( 'read_sp_lists' );
$role->add_cap( 'read_private_sp_lists' );
$role->add_cap( 'edit_sp_list' );
$role->add_cap( 'edit_sp_lists' );
$role->add_cap( 'edit_published_sp_lists' );
$role->add_cap( 'edit_private_sp_lists' );
$role->add_cap( 'edit_others_sp_lists' );
$role->add_cap( 'delete_sp_list' );
$role->add_cap( 'delete_published_sp_lists' );
$role->add_cap( 'delete_private_sp_lists' );
$role->add_cap( 'delete_others_sp_lists' );
$role->add_cap( 'publish_sp_lists' );
// Staff
$role->add_cap( 'edit_sp_staff' );
$role->add_cap( 'edit_sp_staffs' );
$role->add_cap( 'edit_others_sp_staffs' );
$role->add_cap( 'delete_sp_staff' );
$role->add_cap( 'publish_sp_staffs' );
$role->add_cap( 'read_sp_staffs' );
$role->add_cap( 'read_private_sp_staffs' );
$role->add_cap( 'edit_sp_staff' );
$role->add_cap( 'edit_sp_staffs' );
$role->add_cap( 'edit_published_sp_staffs' );
$role->add_cap( 'edit_private_sp_staffs' );
$role->add_cap( 'edit_others_sp_staffs' );
$role->add_cap( 'delete_sp_staff' );
$role->add_cap( 'delete_published_sp_staffs' );
$role->add_cap( 'delete_private_sp_staffs' );
$role->add_cap( 'delete_others_sp_staffs' );
$role->add_cap( 'publish_sp_staffs' );
// Settings
$role->add_cap( 'read_sp_configs' );