Made new module, "opencase_defaults".Added a role

This commit is contained in:
naomi 2018-06-29 13:04:35 +02:00
parent a0ab7282b8
commit 4c7cd2067b
8 changed files with 122 additions and 5 deletions

View File

@ -1,4 +0,0 @@
name: 'Opencase User Roles'
type: module
core: 8.x
package: 'OpenCase Features'

View File

@ -0,0 +1,14 @@
{
"name": "drupal/opencase_defaults",
"type": "drupal-module",
"description": "OpenCase Default Configuration",
"keywords": ["Drupal"],
"license": "GPL-2.0+",
"homepage": "https://www.drupal.org/project/opencase_defaults",
"minimum-stability": "dev",
"support": {
"issues": "https://www.drupal.org/project/issues/opencase_defaults",
"source": "http://cgit.drupalcode.org/opencase_defaults"
},
"require": { }
}

View File

@ -0,0 +1,21 @@
langcode: en
status: true
dependencies: { }
id: opencase_admin
label: 'CRM Admin'
weight: 7
is_admin: null
permissions:
- 'add client entities'
- 'add volunteer entities'
- 'administer oc_activity fields'
- 'administer oc_actor fields'
- 'administer oc_case fields'
- 'administer opencase entity bundles'
- 'administer users'
- 'delete activity entities'
- 'delete case entities'
- 'delete client entities'
- 'delete volunteer entities'
- 'edit client entities'
- 'edit volunteer entities'

View File

@ -0,0 +1,5 @@
name: 'opencase_defaults'
type: module
description: 'OpenCase Default Configuration'
core: 8.x
package: 'OpenCase'

View File

@ -0,0 +1,35 @@
<?php
/**
* @file
* Contains opencase_defaults.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function opencase_defaults_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the opencase_defaults module.
case 'help.page.opencase_defaults':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('OpenCase Default Configuration') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function opencase_defaults_theme() {
return [
'opencase_defaults' => [
'render element' => 'children',
],
];
}

View File

@ -0,0 +1 @@
<!-- Add you custom twig html here -->

View File

@ -0,0 +1,46 @@
<?php
namespace Drupal\Tests\opencase_defaults\Functional;
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
/**
* Simple test to ensure that main page loads with module enabled.
*
* @group opencase_defaults
*/
class LoadTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['opencase_defaults'];
/**
* A user with permission to administer site configuration.
*
* @var \Drupal\user\UserInterface
*/
protected $user;
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->user = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($this->user);
}
/**
* Tests that the home page loads with a 200 response.
*/
public function testLoad() {
$this->drupalGet(Url::fromRoute('<front>'));
$this->assertSession()->statusCodeEquals(200);
}
}