Hide Custom Taxonomy Editor for Specific Role(s) in WP Admin

I know you can select whether to hide or show various aspects of the custom taxonomy editor by passing arguments to the show_ui, meta_box_cb, or show_admin_column fields when registering. Something like:

register_taxonomy(     '',  //NAME OF CATEGORY     '', // NAME OF CUSTOM POST TYPE     array(         'show_ui' => true,         'meta_box_cb' => false,         'show_admin_column' => true     ) ); 

What I am wondering is how can I add a hook/filter beyond this so I check for the role of the current user and then set whether those arguments are true/false depending on the role?

I am here, but stuck:

add_action('in_admin_header', 'restrictTaxonomyEditBy'); function restrictTaxonomyEditBy() {     $  screen = get_current_screen();     $  user = get_current_user_id();     global $  post;         if(!current_user_can('administrator')) {         //ADJUST TAXONOMY PROPERTIES HERE TO HIDE/SHOW ADMIN UI     } } 

How to List All Permissions for SQL Server Fixed Database and Server Roles

I am trying to list all current permissions for db_owner and sysadmin for SQL Server 2012. I found these SPs:

EXEC sp_srvrolepermission 'securityadmin' EXEC sp_dbfixedrolepermission 'db_owner' 

However, these are deprecated and only accurate as of SQL Server 2000. Is there an equivalent mechanism to accomplish the same thing today?

OpenID Connect with user bound roles and M2M access

I’m trying to get my head straight about how to properly design a OpenID connect provider and the roles to use with it. I understand the basic of scopes, claims and the different flow one can use. However, I’m trying to get my head around how I should handle the cases where i want M2M access to all resources, and a end user should only have access to his/her data.

My question is more related to how I should handle roles, is it overkill to have roles such as:

  • view_company_data
  • view_all_data

An example could be to provide a public API to access all data, e.g. collaborating companies, while also allowing me to have specific users to only access the data created by him/her. In my case that would be government body that wants access to all data, whilst the business owners should only have access to their own data.

I have an authentication provider, along with several resource servers. The business owners access their data through our client with only read/write permission for their own entity, and the government body wants access through our APIs to access all the data.

I wish to have all access control in a central entity, so generating access tokens on each separate resource server along with default JWT tokens from the authentication server seems like a bad idea. I’d rather handle it all from the authentication server.

Also a user should be able to generate these full-access tokens, given that they have an Global administration role.

So, what would be the right thing to do here?

Are there non-bridge crew roles?

I am helping to develop a campaign for Star Trek Adventures. This campaign would focus on several new recruits on their first assignment (all ensign or non-commissioned). None of them would be bridge crew. Rather, they would be more rank-and-file members on a smaller ship who would progress to bridge crew throughout the campaign.

One of the last steps in character creation is to choose a role. The roles listed in the core rules are all bridge officers – people who generally have considerable experience already. Are there roles somewhere that are more appropriate to non-bridge crew?

how to create user profile pages and display them based on users roles

Example: I have a website with 3 different user roles (amongst others): *developers *designers *contributors

I would like to have profile pages for users and would like to be able to display users on pages based (filtered) by their role. Hope this is clear. I have researched quite a few membership plugins and found that they are just bloated with features and ended up with TMI and no answers/solutions, so if you can help I would appreciate it. Do you know of any plugins suitable of doing that?

Thanx in advance

Is it correct to use AWS Cognito groups as user roles?

I trying to implement authN/authZ for my application using Spring Security 5.2.2 and OAuth2/openid connect protocols. I use AWS Cognito as an identity provider and I’m trying to implement role-based authorization for my application. I’ve created user groups in the AWS Cognito user pool. In the resource server, when I convert access token, I use this groups (“cognito:groups” claim in the access token) to build granted authorities for spring security. And I manage access in my application based on this groups.

Is this the correct use of AWS Cognito user groups?

What’s the correct way to add capabilites to user roles?

A third-party plugin adds the capability ‘edit_booked_appointments’. I’d like to assign this capability to the already existing user role ‘editor’. I created the following function in my child theme:

function add_booking_role_to_editor() {     $  role = get_role( 'editor' );      $  role->add_cap( 'edit_booked_appointments', true );  }  add_action( 'init', 'add_booking_role_to_editor'); 

As far as I understand the whole topic, user roles get written to the database so there is no need to hook this function into the ‘init’ action. What would be the correct way to do this? Is there a way to fire this once, after the corresponding plugin has been activated? I tried it with the action ‘plugins_loaded’ but that did not work at all.