Skip to content

Commit 123ad25

Browse files
author
Lee Hicks
committed
DF-1293 #comment #resolved Added implements_access_list config option for overriding swagger def for role service access
1 parent 6d919ea commit 123ad25

4 files changed

Lines changed: 55 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
6+
### Added
7+
- DF-1293 Added implements_access_list config option for overriding swagger def for role service access
68
### Fixed
79
- DF-1287 Fixed NodeJS (and Python) script execution for large script. Made script size configurable
810
- DF-1293 Fixed role service access components when swagger def is supplied

database/migrations/2017_08_29_203705_update_script_tables_for_service_linking.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function up()
1919
// so set the default no action and clear out created/modified by another user when deleting a user.
2020
$onDelete = (('sqlsrv' === $driver) ? 'no action' : 'set null');
2121

22-
if(Schema::hasTable('script_config') && !Schema::hasColumn('script_config', 'storage_service_id')){
22+
if (Schema::hasTable('script_config') && !Schema::hasColumn('script_config', 'storage_service_id')) {
2323
Schema::table('script_config', function (Blueprint $t) use ($onDelete) {
2424
$t->string('scm_reference')->nullable()->after('config');
2525
$t->string('scm_repository')->nullable()->after('config');
@@ -29,7 +29,7 @@ public function up()
2929
});
3030
}
3131

32-
if(Schema::hasTable('event_script') && !Schema::hasColumn('event_script', 'storage_service_id')){
32+
if (Schema::hasTable('event_script') && !Schema::hasColumn('event_script', 'storage_service_id')) {
3333
Schema::table('event_script', function (Blueprint $t) use ($onDelete) {
3434
$t->string('scm_reference')->nullable()->after('config');
3535
$t->string('scm_repository')->nullable()->after('config');
@@ -47,19 +47,21 @@ public function up()
4747
*/
4848
public function down()
4949
{
50-
if(Schema::hasTable('script_config') && Schema::hasColumn('script_config', 'storage_service_id')) {
51-
Schema::table('script_config', function (Blueprint $t){
50+
if (Schema::hasTable('script_config') && Schema::hasColumn('script_config', 'storage_service_id')) {
51+
Schema::table('script_config', function (Blueprint $t) {
5252
$t->dropColumn('storage_service_id');
5353
$t->dropColumn('storage_path');
5454
$t->dropColumn('scm_reference');
55+
$t->dropColumn('scm_repository');
5556
});
5657
}
5758

58-
if(Schema::hasTable('event_script') && Schema::hasColumn('event_script', 'storage_service_id')) {
59-
Schema::table('event_script', function (Blueprint $t){
59+
if (Schema::hasTable('event_script') && Schema::hasColumn('event_script', 'storage_service_id')) {
60+
Schema::table('event_script', function (Blueprint $t) {
6061
$t->dropColumn('storage_service_id');
6162
$t->dropColumn('storage_path');
6263
$t->dropColumn('scm_reference');
64+
$t->dropColumn('scm_repository');
6365
});
6466
}
6567
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class ScriptImplementsAccessList extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('script_config', function (Blueprint $table) {
17+
$table->boolean('implements_access_list')->default(0)->after('queued');
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
Schema::table('script_config', function (Blueprint $table) {
29+
$table->dropColumn('implements_access_list');
30+
});
31+
}
32+
}

src/Models/ScriptConfig.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ class ScriptConfig extends BaseServiceConfigModel
2727
'storage_service_id',
2828
'scm_reference',
2929
'scm_repository',
30-
'storage_path'
30+
'storage_path',
31+
'implements_access_list',
3132
];
3233

3334
// deprecated, service has type designation now
3435
protected $hidden = ['type'];
3536

3637
protected $casts = [
37-
'service_id' => 'integer',
38-
'config' => 'array',
39-
'queued' => 'boolean',
40-
'storage_service_id' => 'integer',
38+
'service_id' => 'integer',
39+
'config' => 'array',
40+
'queued' => 'boolean',
41+
'storage_service_id' => 'integer',
42+
'implements_access_list' => 'boolean'
4143
];
4244

4345
/**
@@ -88,8 +90,6 @@ protected static function prepareConfigSchemaField(array &$schema)
8890
break;
8991
case 'queued':
9092
$schema['label'] = 'Queue For Later Execution';
91-
$schema['type'] = 'boolean';
92-
$schema['default'] = false;
9393
$schema['description'] =
9494
'Select to queue the script for later execution ' .
9595
'(queuing success or failure returned to client immediately), ' .
@@ -113,6 +113,12 @@ protected static function prepareConfigSchemaField(array &$schema)
113113
case 'storage_service_id':
114114
$schema['type'] = 'integer';
115115
break;
116+
case 'implements_access_list':
117+
$schema['label'] = 'Script Implements Access List';
118+
$schema['description'] =
119+
'By default, the access list is generated by the OpenAPI specification provided. ' .
120+
'To override, check this and implement the access list in the script.';
121+
break;
116122
}
117123
}
118124
}

0 commit comments

Comments
 (0)