Add proper permissions to admin role
This commit is contained in:
@@ -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' );
|
||||
|
||||
@@ -14,7 +14,7 @@ function sportspress_calendar_post_init() {
|
||||
'rewrite' => array( 'slug' => get_option( 'sp_calendar_slug', 'calendars' ) ),
|
||||
'show_in_menu' => 'edit.php?post_type=sp_event',
|
||||
'show_in_admin_bar' => true,
|
||||
// 'capability_type' => 'sp_calendar'
|
||||
'capability_type' => 'sp_calendar'
|
||||
);
|
||||
register_post_type( 'sp_calendar', $args );
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ function sportspress_table_post_init() {
|
||||
'rewrite' => array( 'slug' => get_option( 'sp_table_slug', 'tables' ) ),
|
||||
'show_in_menu' => 'edit.php?post_type=sp_team',
|
||||
'show_in_admin_bar' => true,
|
||||
// 'capability_type' => 'sp_table'
|
||||
'capability_type' => 'sp_table'
|
||||
);
|
||||
register_post_type( 'sp_table', $args );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user