How do I code access to the built-in UI of a CPT when it’s placed as submenu of another CPT that is protected by role?

I am toying around with WordPress capabilities, and having some difficulty understanding where I am going wrong. Right now, I have an admin menu that appears for all administrators with STUDENTS as a submenu of SCHOOL: each of those link to (When the user is in the HEADMASTER role, the link to the built-in UI for TEACHER appears and SCHOOL mimics its link). So far, all is well.

The bump in the road is when a non-HEADMASTER administrator clicks either SCHOOL or STUDENTS, the error “Sorry, you are not allowed to access this page” appears. (As expected, when that same admin accesses, the errors “You need a higher level of permission” and “Sorry, you are not allowed to edit posts in this post type” appear.) The issue is that the STUDENTS built-in UI is not accessible to all administrators. (As expected, there are no problems for HEADMASTERs.) How can this be resolved in such a way as to give all site admins access to STUDENTS and only HEADMASTERs access to TEACHERS while at the same time preserving the layout and functionality of the admin menu and built-in UI?

What I’ve Tried: When the 'show_in_menu' => 'edit.php?post_type=teacher' line is removed from the STUDENTS CPT, everything works as expected but STUDENTS becomes a top-level menu item instead of SCHOOL. I tried putting TEACHERS as a sub-menu item as STUDENTS, but SCHOOL does not change its link when the user is in the HEADMASTER role (also the ordering of TEACHERS and STUDENTS is backwards). I also tried add_menu_page() for SCHOOL and adding the slug returned for the show_in_menu argument of the TEACHERS and STUDENTS register_post_type args, respectively, but that didn’t work because it created a page instead of forwarding to the appropriate built-in UI.

 class School {     public static function init() {         add_action('init', array(__CLASS__, 'register_cpt'));         add_action('init', array(__CLASS__, 'add_role'));         add_action('admin_menu', array(__CLASS__, 'modify_menu'));     }      public static function register_cpt() {         register_post_type('teacher', array(             'labels' => array(                 'name'          => __('TEACHER'),                 'all_items'     => __('TEACHERS'),                 'menu_name'     => __('SCHOOL'),             ),             'show_ui'           => TRUE,             'capability_type'   => 'educator',             'map_meta_cap'      => TRUE,         ));         register_post_type('student', array(             'labels' => array(                 'name'          => __('STUDENT'),                 'menu_name'     => __('STUDENTS'),             ),             'show_ui'           => TRUE,             'show_in_menu'      => 'edit.php?post_type=teacher',         ));     }      public static function add_role() {         if(get_role('headmaster') === NULL) {             $  caps = array();             foreach(get_role('administrator')->capabilities as $  cap => $  tmp) {                 $  pos = strpos($  cap, 'post');                 if($  pos !== FALSE) {                     $  cap = str_replace('post', 'educator', $  cap);                     $  caps[$  cap] = TRUE;                 }             }             add_role('headmaster', 'HEADMASTER', $  caps);         }     }      public static function modify_menu() {         global $  submenu;         unset($  submenu['edit.php?post_type=teacher'][10]);     } } School::init(); 

Role playing games with no humans [closed]

Because of story setting no humans should be available as playable entities, instead other creatures some of which might look or resemble humans and some of which are not even humanoid are playble.

This however puts some worries on me, is anyone even gonna play my game? As far as I know all famous rpg’s game have humans as playable characters and its common that humans are also the most played entity in such games.

Should I just change my games lore and avoid wasting my time?

Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type

For a WordPress project I made a Custom Post Type in the usual manner. Also i made a custom role. I want users with that role to be able to make, edit and delete this CPT. I added the apropriate capabilities to this role. These are the caps:

'level_1' => true, // seems necessary to asign this author as a post_author by other users 'read' => true, 'view_admin_dashboard' => true, 'upload_files' => true, 'publish_{my_cpts}' => true, 'edit_{my_cpts}' => true, 'edit_others_{my_cpts}' => false, 'delete_{my_cpts}' => true, 'delete_others_{my_cpts}' => false, 'read_private_{my_cpts}' => true, 'edit_{my_cpt}' => true, 'delete_{my_cpt}' => true, 'read_{my_cpt}' => true 

I map these capabilities also in the args for adding the cpt. Upon making the CPT, I did not forget to add ‘thumbnail’ to the ‘supports’ argument. And i added theme-support for thumbnails, also for my cpt

However, i don’t want users with this role to be able to edit ordinary posts.

I think i don’t need to provide more details on this because everything works fine.

Except for the featured image panel in Gutenberg. This panel seems to display only if a user has the edit_posts capability, which my users don’t have. The panel shows for other users, it only remains hidden for users with my custom role.

For now, I made a workaround with an ACF-image field. Images uploaded with this custom field I make the featured-image in a save_post hook.

But this is a workaround, I prefer the usual panel. Any suggestions? I find this an unusual hard nut to crack.

What is Jester using as a focus for Scrying in Critical Role?

Reading through the PHB, I found the spell Scrying, which has the following Components:

Components: V, S, M, (a focus worth at least 1000 gp, such as a crystal ball, a silver mirror or a font filled with holy water).

However, I never heard mention of such a focus in the show, even with Jester often Scrying in the wild. What object is she using?

Why is Jester blue and Lillith white in Critical Role?

I do not watch Critical Role and know very little about it.

However, whilst looking into different skin colours for tieflings, I discovered the characters Jester Lavorre, who has blue skin, and Lillith Daturai, who has white skin. I am curious to know what in-universe lore exists in Matt Mercer’s homebrew universe to explain why these tiefling characters have the skin colour that they do. Searching online, I have been unable to find such information, simply that they are the colours that they are, not why.

I believe the Explorer’s Guide to Wildemount book is out now, and I don’t know if this is the sort of thing that would be in that book, but I don’t know where else such lore might be found besides watching the show (or possibly statements by those involved in the show, such as Matt Mercer, etc). For reasons unrelated to this question/lore that I don’t want to expand on, watching the show is not something I plan to do, but I’m still curious about the universe and the lore relating to these tieflings’ skin colour.

So, from an in-universe lore perspective, why is Jester blue and Lillith white in the Critical Role homebrew universe?

How did the role of animal companions change between different editions of DnD and which classes had access to them?

In DnD 3.5, druids had animal companions. In DnD 5e, only a Ranger (Beastmaster) seems to get one. This made me wonder about the history of this feature in general.

Which classes had access to animal companions in which edition of DnD, and how do their abilities differ?

Can’t create schema from `assumed` role with ALL privileges

For the postgresql 10 have this code:


AND then log in as editor, and

SET ROLE FEATURESTORE_MIGRATIONS; SELECT current_database()               # returns featurestore SELECT SESSION_USER, CURRENT_USER;      # returns editor, fstore_migrations CREATE SCHEMA IF NOT EXISTS BUILDINGS   # (psycopg2.errors.InsufficientPrivilege) permission denied for database featurestore 

What did I miss? Is there any way to see permissions on database (rather than specific tables/schemas ?

What role does the school of necromancy play in the world of 5e? [duplicate]

The school of necromancy subclass states:

The School of Necromancy explores the cosmic forces of life, death, and undeath.

Which doesn’t sound inherently evil.

Obviously a Necromancer makes a classic villain in the world of DnD but I find myself unsure about whether villains like necromancy or necromancers like villainy.

Is raising skeletons, zombies, ghouls and mummies inherently evil or only frowned upon by some societies?

Are there good necromancers in the world of 5e?