SystemActionController.java

/*
 * Copyright 2026 Global Crop Diversity Trust
 * Licensed under the Apache License, Version 2.0
 * See LICENSE file in project root folder or http://www.apache.org/licenses/LICENSE-2.0
 */

package org.gringlobal.api.v2.impl;

import org.gringlobal.api.ApiBaseController;
import org.gringlobal.api.model.SystemActionDTO;
import org.gringlobal.api.model.SystemActionRequestDTO;
import org.gringlobal.api.v2.ActionController;
import org.gringlobal.api.v2.facade.SystemActionApiService;
import org.gringlobal.model.SystemAction;
import org.gringlobal.service.SystemActionService.SystemActionScheduleFilter;
import org.gringlobal.service.filter.SystemActionFilter;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.tags.Tag;

@RestController("systemActionApi2")
@RequestMapping(SystemActionController.API_URL)
@PreAuthorize("hasRole('ADMINISTRATOR') or @ggceSec.actionAllowed('SystemAction', 'ADMINISTRATION')")
@Tag(name = "SystemAction")
public class SystemActionController extends ActionController<SystemActionDTO, SystemAction, SystemActionFilter, SystemActionRequestDTO, SystemActionScheduleFilter, SystemActionApiService> {

	public static final String API_URL = ApiBaseController.APIv2_BASE + "/system";
}