Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(workflowengine): Replace security annotations with respective attributes #46825

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/workflowengine/lib/Controller/RequestTimeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
namespace OCA\WorkflowEngine\Controller;

use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\JSONResponse;

class RequestTimeController extends Controller {

/**
* @NoAdminRequired
*
* @param string $search
* @return JSONResponse
*/
#[NoAdminRequired]
public function getTimezones($search = '') {
$timezones = \DateTimeZone::listIdentifiers();

Expand Down
12 changes: 6 additions & 6 deletions apps/workflowengine/lib/Controller/UserWorkflowsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use OCA\WorkflowEngine\Helper\ScopeContext;
use OCA\WorkflowEngine\Manager;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSBadRequestException;
Expand Down Expand Up @@ -44,47 +45,46 @@ public function __construct(
*
* Example: curl -u joann -H "OCS-APIREQUEST: true" "http://my.nc.srvr/ocs/v2.php/apps/workflowengine/api/v1/workflows/user?format=json"
*
* @NoAdminRequired
* @throws OCSForbiddenException
*/
#[NoAdminRequired]
public function index(): DataResponse {
return parent::index();
}

/**
* @NoAdminRequired
*
* Example: curl -u joann -H "OCS-APIREQUEST: true" "http://my.nc.srvr/ocs/v2.php/apps/workflowengine/api/v1/workflows/user/OCA\\Workflow_DocToPdf\\Operation?format=json"
* @throws OCSForbiddenException
*/
#[NoAdminRequired]
public function show(string $id): DataResponse {
return parent::show($id);
}

/**
* @NoAdminRequired
* @throws OCSBadRequestException
* @throws OCSForbiddenException
*/
#[NoAdminRequired]
#[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);
}

/**
* @NoAdminRequired
* @throws OCSBadRequestException
* @throws OCSForbiddenException
*/
#[NoAdminRequired]
#[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);
}

/**
* @NoAdminRequired
* @throws OCSForbiddenException
*/
#[NoAdminRequired]
#[PasswordConfirmationRequired]
public function destroy(int $id): DataResponse {
return parent::destroy($id);
Expand Down
Loading