mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 22:27:31 -04:00
fix(workflows): Finish password confirmation
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
50f8d6c129
commit
d8ffbed2c2
3 changed files with 11 additions and 4 deletions
|
|
@ -30,6 +30,7 @@ namespace OCA\WorkflowEngine\Controller;
|
|||
use Doctrine\DBAL\Exception;
|
||||
use OCA\WorkflowEngine\Helper\ScopeContext;
|
||||
use OCA\WorkflowEngine\Manager;
|
||||
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCS\OCSBadRequestException;
|
||||
use OCP\AppFramework\OCS\OCSException;
|
||||
|
|
@ -103,6 +104,7 @@ abstract class AWorkflowController extends OCSController {
|
|||
* @throws OCSForbiddenException
|
||||
* @throws OCSException
|
||||
*/
|
||||
#[PasswordConfirmationRequired]
|
||||
public function create(
|
||||
string $class,
|
||||
string $name,
|
||||
|
|
@ -131,6 +133,7 @@ abstract class AWorkflowController extends OCSController {
|
|||
* @throws OCSForbiddenException
|
||||
* @throws OCSException
|
||||
*/
|
||||
#[PasswordConfirmationRequired]
|
||||
public function update(
|
||||
int $id,
|
||||
string $name,
|
||||
|
|
@ -159,6 +162,7 @@ abstract class AWorkflowController extends OCSController {
|
|||
* @throws OCSForbiddenException
|
||||
* @throws OCSException
|
||||
*/
|
||||
#[PasswordConfirmationRequired]
|
||||
public function destroy(int $id): DataResponse {
|
||||
try {
|
||||
$deleted = $this->manager->deleteOperation($id, $this->getScopeContext());
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ namespace OCA\WorkflowEngine\Controller;
|
|||
|
||||
use OCA\WorkflowEngine\Helper\ScopeContext;
|
||||
use OCA\WorkflowEngine\Manager;
|
||||
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCS\OCSBadRequestException;
|
||||
use OCP\AppFramework\OCS\OCSForbiddenException;
|
||||
|
|
@ -84,6 +85,7 @@ class UserWorkflowsController extends AWorkflowController {
|
|||
* @throws OCSBadRequestException
|
||||
* @throws OCSForbiddenException
|
||||
*/
|
||||
#[PasswordConfirmationRequired]
|
||||
public function create(string $class, string $name, array $checks, string $operation, string $entity, array $events): DataResponse {
|
||||
return parent::create($class, $name, $checks, $operation, $entity, $events);
|
||||
}
|
||||
|
|
@ -93,6 +95,7 @@ class UserWorkflowsController extends AWorkflowController {
|
|||
* @throws OCSBadRequestException
|
||||
* @throws OCSForbiddenException
|
||||
*/
|
||||
#[PasswordConfirmationRequired]
|
||||
public function update(int $id, string $name, array $checks, string $operation, string $entity, array $events): DataResponse {
|
||||
return parent::update($id, $name, $checks, $operation, $entity, $events);
|
||||
}
|
||||
|
|
@ -101,6 +104,7 @@ class UserWorkflowsController extends AWorkflowController {
|
|||
* @NoAdminRequired
|
||||
* @throws OCSForbiddenException
|
||||
*/
|
||||
#[PasswordConfirmationRequired]
|
||||
public function destroy(int $id): DataResponse {
|
||||
return parent::destroy($id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,8 @@ const store = new Store({
|
|||
context.commit('addRule', rule)
|
||||
})
|
||||
},
|
||||
createNewRule(context, rule) {
|
||||
async createNewRule(context, rule) {
|
||||
await confirmPassword()
|
||||
let entity = null
|
||||
let events = []
|
||||
if (rule.isComplex === false && rule.fixedEntity === '') {
|
||||
|
|
@ -120,9 +121,7 @@ const store = new Store({
|
|||
context.commit('removeRule', rule)
|
||||
},
|
||||
async pushUpdateRule(context, rule) {
|
||||
if (context.state.scope === 0) {
|
||||
await confirmPassword()
|
||||
}
|
||||
await confirmPassword()
|
||||
let result
|
||||
if (rule.id < 0) {
|
||||
result = await axios.post(getApiUrl(''), rule)
|
||||
|
|
|
|||
Loading…
Reference in a new issue