Skip to content

Commit

Permalink
Merge pull request #41520 from nextcloud/bugfix/noid/finish-password-…
Browse files Browse the repository at this point in the history
…confirmation

Finish password confirmation
  • Loading branch information
blizzz authored Nov 16, 2023
2 parents 50f8d6c + 9e1e6a8 commit 6099321
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions apps/workflowengine/lib/Controller/AWorkflowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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;
Expand Down Expand Up @@ -103,6 +104,7 @@ public function show(string $id): DataResponse {
* @throws OCSForbiddenException
* @throws OCSException
*/
#[PasswordConfirmationRequired]
public function create(
string $class,
string $name,
Expand Down Expand Up @@ -131,6 +133,7 @@ public function create(
* @throws OCSForbiddenException
* @throws OCSException
*/
#[PasswordConfirmationRequired]
public function update(
int $id,
string $name,
Expand Down Expand Up @@ -159,6 +162,7 @@ public function update(
* @throws OCSForbiddenException
* @throws OCSException
*/
#[PasswordConfirmationRequired]
public function destroy(int $id): DataResponse {
try {
$deleted = $this->manager->deleteOperation($id, $this->getScopeContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

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;
Expand Down Expand Up @@ -84,6 +85,7 @@ public function show(string $id): DataResponse {
* @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);
}
Expand All @@ -93,6 +95,7 @@ public function create(string $class, string $name, array $checks, string $opera
* @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);
}
Expand All @@ -101,6 +104,7 @@ public function update(int $id, string $name, array $checks, string $operation,
* @NoAdminRequired
* @throws OCSForbiddenException
*/
#[PasswordConfirmationRequired]
public function destroy(int $id): DataResponse {
return parent::destroy($id);
}
Expand Down
7 changes: 3 additions & 4 deletions apps/workflowengine/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '') {
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions dist/workflowengine-workflowengine.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/workflowengine-workflowengine.js.map

Large diffs are not rendered by default.

0 comments on commit 6099321

Please sign in to comment.