Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wcms/uw_cfg_common
1 result
Show changes
enabled_entity_types:
- block_content
- user
punctuation:
double_quotes: 0
quotes: 0
backtick: 0
comma: 0
period: 0
hyphen: 1
underscore: 0
colon: 0
semicolon: 0
pipe: 0
left_curly: 0
left_square: 0
right_curly: 0
right_square: 0
plus: 0
equal: 0
asterisk: 0
ampersand: 0
percent: 0
caret: 0
dollar: 0
hash: 0
at: 0
exclamation: 0
tilde: 0
left_parenthesis: 0
right_parenthesis: 0
question_mark: 0
less_than: 0
greater_than: 0
slash: 0
back_slash: 0
verbose: false
separator: '-'
max_length: 255
max_component_length: 60
transliterate: true
reduce_ascii: true
case: true
ignore_words: 'a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with, le, la, l, les, un, une, des, du, de'
update_action: 2
safe_tokens:
- alias
- path
- join-path
- login-url
- url
- url-brief
langcode: en
status: true
dependencies: { }
name: Audience
vid: uw_vocab_audience
description: 'Who does this content apply to?'
weight: 0
......@@ -40,10 +40,14 @@ permissions:
- 'create paragraph content uw_para_ff'
- 'create terms in uw_tax_event_tags'
- 'create terms in uw_tax_event_type'
- 'create terms in uw_vocab_audience'
- 'create terms in uw_vocab_blog_tags'
- 'create terms in uw_vocab_catalog_categories'
- 'create terms in uw_vocab_catalogs'
- 'create terms in uw_vocab_news_tags'
- 'create url aliases'
- 'create uw_ct_blog content'
- 'create uw_ct_catalog_item content'
- 'create uw_ct_event content'
- 'create uw_ct_news_item content'
- 'create uw_ct_sidebar content'
......@@ -60,12 +64,14 @@ permissions:
- 'delete paragraph content uw_para_facts_and_figures'
- 'delete paragraph content uw_para_ff'
- 'edit any uw_ct_blog content'
- 'edit any uw_ct_catalog_item content'
- 'edit any uw_ct_event content'
- 'edit any uw_ct_news_item content'
- 'edit any uw_ct_sidebar content'
- 'edit any uw_ct_site_footer content'
- 'edit any uw_ct_web_page content'
- 'edit own uw_ct_blog content'
- 'edit own uw_ct_catalog_item content'
- 'edit own uw_ct_event content'
- 'edit own uw_ct_news_item content'
- 'edit own uw_ct_sidebar content'
......@@ -74,11 +80,15 @@ permissions:
- 'edit own uw_news_item content'
- 'edit terms in uw_tax_event_tags'
- 'edit terms in uw_tax_event_type'
- 'edit terms in uw_vocab_audience'
- 'edit terms in uw_vocab_blog_tags'
- 'edit terms in uw_vocab_catalog_categories'
- 'edit terms in uw_vocab_catalogs'
- 'edit terms in uw_vocab_news_tags'
- 'make smart dates recur'
- 'reschedule smart date recur instances'
- 'revert uw_ct_blog revisions'
- 'revert uw_ct_catalog_item revisions'
- 'revert uw_ct_event revisions'
- 'revert uw_ct_news_item revisions'
- 'revert uw_ct_sidebar revisions'
......@@ -103,6 +113,7 @@ permissions:
- 'view own unpublished media'
- 'view unpublished paragraphs'
- 'view uw_ct_blog revisions'
- 'view uw_ct_catalog_item revisions'
- 'view uw_ct_event revisions'
- 'view uw_ct_news_item revisions'
- 'view uw_ct_sidebar revisions'
......
......@@ -41,10 +41,14 @@ permissions:
- 'create paragraph content uw_para_ff'
- 'create terms in uw_tax_event_tags'
- 'create terms in uw_tax_event_type'
- 'create terms in uw_vocab_audience'
- 'create terms in uw_vocab_blog_tags'
- 'create terms in uw_vocab_catalog_categories'
- 'create terms in uw_vocab_catalogs'
- 'create terms in uw_vocab_news_tags'
- 'create url aliases'
- 'create uw_ct_blog content'
- 'create uw_ct_catalog_item content'
- 'create uw_ct_event content'
- 'create uw_ct_news_item content'
- 'create uw_ct_sidebar content'
......@@ -61,12 +65,14 @@ permissions:
- 'delete paragraph content uw_para_facts_and_figures'
- 'delete paragraph content uw_para_ff'
- 'edit any uw_ct_blog content'
- 'edit any uw_ct_catalog_item content'
- 'edit any uw_ct_event content'
- 'edit any uw_ct_news_item content'
- 'edit any uw_ct_sidebar content'
- 'edit any uw_ct_site_footer content'
- 'edit any uw_ct_web_page content'
- 'edit own uw_ct_blog content'
- 'edit own uw_ct_catalog_item content'
- 'edit own uw_ct_event content'
- 'edit own uw_ct_news_item content'
- 'edit own uw_ct_sidebar content'
......@@ -75,11 +81,15 @@ permissions:
- 'edit own uw_news_item content'
- 'edit terms in uw_tax_event_tags'
- 'edit terms in uw_tax_event_type'
- 'edit terms in uw_vocab_audience'
- 'edit terms in uw_vocab_blog_tags'
- 'edit terms in uw_vocab_catalog_categories'
- 'edit terms in uw_vocab_catalogs'
- 'edit terms in uw_vocab_news_tags'
- 'make smart dates recur'
- 'reschedule smart date recur instances'
- 'revert uw_ct_blog revisions'
- 'revert uw_ct_catalog_item revisions'
- 'revert uw_ct_event revisions'
- 'revert uw_ct_news_item revisions'
- 'revert uw_ct_sidebar revisions'
......@@ -107,6 +117,7 @@ permissions:
- 'view own unpublished media'
- 'view unpublished paragraphs'
- 'view uw_ct_blog revisions'
- 'view uw_ct_catalog_item revisions'
- 'view uw_ct_event revisions'
- 'view uw_ct_news_item revisions'
- 'view uw_ct_sidebar revisions'
......
......@@ -42,10 +42,14 @@ permissions:
- 'create paragraph content uw_para_ff'
- 'create terms in uw_tax_event_tags'
- 'create terms in uw_tax_event_type'
- 'create terms in uw_vocab_audience'
- 'create terms in uw_vocab_blog_tags'
- 'create terms in uw_vocab_catalog_categories'
- 'create terms in uw_vocab_catalogs'
- 'create terms in uw_vocab_news_tags'
- 'create url aliases'
- 'create uw_ct_blog content'
- 'create uw_ct_catalog_item content'
- 'create uw_ct_event content'
- 'create uw_ct_news_item content'
- 'create uw_ct_sidebar content'
......@@ -55,6 +59,7 @@ permissions:
- 'delete all revisions'
- 'delete any media'
- 'delete any uw_ct_blog content'
- 'delete any uw_ct_catalog_item content'
- 'delete any uw_ct_event content'
- 'delete any uw_ct_news_item content'
- 'delete any uw_ct_sidebar content'
......@@ -63,6 +68,7 @@ permissions:
- 'delete any uw_news_item content'
- 'delete orphan revisions'
- 'delete own uw_ct_blog content'
- 'delete own uw_ct_catalog_item content'
- 'delete own uw_ct_event content'
- 'delete own uw_ct_news_item content'
- 'delete own uw_ct_sidebar content'
......@@ -79,10 +85,14 @@ permissions:
- 'delete paragraph content uw_para_ff'
- 'delete terms in uw_tax_event_tags'
- 'delete terms in uw_tax_event_type'
- 'delete terms in uw_vocab_audience'
- 'delete terms in uw_vocab_blog_tags'
- 'delete terms in uw_vocab_catalog_categories'
- 'delete terms in uw_vocab_catalogs'
- 'delete terms in uw_vocab_news_tags'
- 'delete uw_news_item revisions'
- 'edit any uw_ct_blog content'
- 'edit any uw_ct_catalog_item content'
- 'edit any uw_ct_event content'
- 'edit any uw_ct_news_item content'
- 'edit any uw_ct_sidebar content'
......@@ -90,6 +100,7 @@ permissions:
- 'edit any uw_ct_web_page content'
- 'edit any uw_news_item content'
- 'edit own uw_ct_blog content'
- 'edit own uw_ct_catalog_item content'
- 'edit own uw_ct_event content'
- 'edit own uw_ct_news_item content'
- 'edit own uw_ct_sidebar content'
......@@ -98,12 +109,16 @@ permissions:
- 'edit own uw_news_item content'
- 'edit terms in uw_tax_event_tags'
- 'edit terms in uw_tax_event_type'
- 'edit terms in uw_vocab_audience'
- 'edit terms in uw_vocab_blog_tags'
- 'edit terms in uw_vocab_catalog_categories'
- 'edit terms in uw_vocab_catalogs'
- 'edit terms in uw_vocab_news_tags'
- 'make smart dates recur'
- 'reschedule smart date recur instances'
- 'revert all revisions'
- 'revert uw_ct_blog revisions'
- 'revert uw_ct_catalog_item revisions'
- 'revert uw_ct_event revisions'
- 'revert uw_ct_news_item revisions'
- 'revert uw_ct_sidebar revisions'
......@@ -132,6 +147,7 @@ permissions:
- 'view own unpublished media'
- 'view unpublished paragraphs'
- 'view uw_ct_blog revisions'
- 'view uw_ct_catalog_item revisions'
- 'view uw_ct_event revisions'
- 'view uw_ct_news_item revisions'
- 'view uw_ct_sidebar revisions'
......
......@@ -61,6 +61,17 @@ class UwPermissions {
UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_blog_tags', ['delete']),
],
// Catalog permissions.
'Catalog' => [
'Use content type' => UwPermissions::buildRolePermissionsListContentType('uw_ct_catalog_item'),
'Create/edit audience' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_audience', ['create', 'edit']),
'Delete audience' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_audience', ['delete']),
'Create/edit categories' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_catalog_categories', ['create', 'edit']),
'Delete categories' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_catalog_categories', ['delete']),
'Create/edit catalogs' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_catalogs', ['create', 'edit']),
'Delete catalogs' => UwPermissions::buildRolePermissionsListTaxonomyTerm('uw_vocab_catalogs', ['delete']),
],
// Event permissions.
'Event' => [
'Use content type' => UwPermissions::buildRolePermissionsListContentType('uw_ct_event'),
......
......@@ -15,6 +15,7 @@ dependencies:
- filter
- hcaptcha
- hook_event_dispatcher
- language
- layout_builder
- layout_builder_browser
- layout_builder_modal
......@@ -22,7 +23,10 @@ dependencies:
- layout_builder_styles
- linkit
- media
- metatag
- node
- pathauto
- preprocess_event_dispatcher
- taxonomy
- user
- views
......@@ -27,6 +27,37 @@ function uw_cfg_common_install() {
'Site manager',
],
],
'Catalog' => [
'Use content type' => [
'Site manager',
'Content author',
'Content editor',
],
'Create/edit audience' => [
'Site manager',
'Content author',
'Content editor',
],
'Delete audience' => [
'Site manager',
],
'Create/edit categories' => [
'Site manager',
'Content author',
'Content editor',
],
'Delete categories' => [
'Site manager',
],
'Create/edit catalogs' => [
'Site manager',
'Content author',
'Content editor',
],
'Delete catalogs' => [
'Site manager',
],
],
'Event' => [
'Use content type' => [
'Site manager',
......@@ -95,4 +126,82 @@ function uw_cfg_common_install() {
],
];
UwPermissions::grantRevoke($permissions_to_process, 'grant');
// Add terms to the vocabulary 'uw_vocab_audience'.
$terms = [
'Current students' => [
'Current undergraduate students',
'Current graduate students',
],
'Future students' => [
'Future undergraduate students',
'Future graduate students',
],
'Faculty',
'Staff',
'Alumni',
'Parents',
'Donors | Friends | Supporters',
'Employers',
'International',
'Media',
];
$weight = 0;
foreach ($terms as $key => $term) {
if (is_array($term)) {
$parent = _uw_cfg_common_create_term($key, 'uw_vocab_audience', $weight, []);
foreach ($term as $child) {
_uw_cfg_common_create_term($child, 'uw_vocab_audience', $weight, [$parent]);
}
}
else {
_uw_cfg_common_create_term($term, 'uw_vocab_audience', $weight, []);
}
$weight++;
}
}
/**
* @file
* Contains various helper functions.
*/
/**
* Helper function to create a taxonomy term programmatically.
*
* @code
* // Create top level term
* $term_id = _nodemaker_term_create('My Term', 'my_vocab', 0, []);
*
* // Create term with parent term with an id of 999
* $term_id = _nodemaker_term_create('My Term', 'my_vocab', 0, [999]);
* @endcode
*
* @param string $term
* - Term Name.
* @param string $vocabulary
* - System id of the vocabulary term will be added to.
* @param array $parent
* - Array of term ids to be assigned as parent.
*
* @return int|null
* - Returns the term id of the created term on success, null on failure.
*/
function _uw_cfg_common_create_term($taxonomy_name, $vocab_machine_name, $weight, array $parent_tid = []) {
// Create the taxonomy term.
$new_term = Drupal\taxonomy\Entity\Term::create([
'name' => $taxonomy_name,
'vid' => $vocab_machine_name,
'parent' => $parent_tid,
'weight' => $weight,
]);
// Save the taxonomy term.
$new_term->save();
// Return the taxonomy term id.
return $new_term->id();
}