1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-22 14:11:39 +00:00

Closes #252: route model permissions

This commit is contained in:
Benjamin Gamard
2018-10-28 17:03:21 +01:00
parent dc5a157dad
commit 4910dfd527
11 changed files with 128 additions and 35 deletions

View File

@@ -59,26 +59,6 @@ angular.module('docs').controller('SettingsWorkflowEdit', function($scope, $dial
return $stateParams.id;
};
/**
* In edit mode, load the current workflow.
*/
if ($scope.isEdit()) {
Restangular.one('routemodel', $stateParams.id).get().then(function (data) {
$scope.workflow = data;
$scope.workflow.steps = JSON.parse(data.steps);
_.each($scope.workflow.steps, function (step) {
if (!step.transitions) {
// Patch for old route models
$scope.updateTransitions(step);
}
});
});
} else {
$scope.workflow = {
steps: []
}
}
/**
* Update the current workflow.
*/
@@ -188,4 +168,25 @@ angular.module('docs').controller('SettingsWorkflowEdit', function($scope, $dial
Restangular.one('tag/list').get().then(function(data) {
$scope.tags = data.tags;
});
/**
* In edit mode, load the current workflow.
*/
if ($scope.isEdit()) {
Restangular.one('routemodel', $stateParams.id).get().then(function (data) {
$scope.workflow = data;
$scope.workflow.steps = JSON.parse(data.steps);
_.each($scope.workflow.steps, function (step) {
if (!step.transitions) {
// Patch for old route models
$scope.updateTransitions(step);
}
});
});
} else {
$scope.workflow = {
steps: []
};
$scope.addStep();
}
});

View File

@@ -311,7 +311,8 @@
"target_help": "<strong>Approve:</strong> Accept or reject the review<br/><strong>Validate:</strong> Review and continue the workflow",
"add_step": "Add a workflow step",
"actions": "What happens after?",
"remove_action": "Remove action"
"remove_action": "Remove action",
"acl_info": "Only users and groups defined here will be able to start this workflow on a document"
}
},
"security": {

View File

@@ -136,6 +136,16 @@
</div>
</div>
<div class="panel panel-default mt-30" ng-show="isEdit()">
<div class="panel-body">
<p translate="settings.workflow.edit.acl_info"></p>
<acl-edit source="workflow.id"
acls="workflow.acls"
writable="workflow.writable"
creator="workflow.creator"></acl-edit>
</div>
</div>
<div class="clearfix form-group mt-10">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary" ng-click="edit()" ng-disabled="!editWorkflowForm.$valid">

View File

@@ -607,6 +607,10 @@ input[readonly].share-link {
margin-bottom: 19px;
}
.mt-30 {
margin-top: 30px;
}
.ml-10 {
margin-left: 10px;
}