xyz.erupt.upms.model.log.SuperAdminPower Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of erupt-upms Show documentation
Show all versions of erupt-upms Show documentation
User Permissions Management
The newest version!
package xyz.erupt.upms.model.log;
import org.springframework.stereotype.Component;
import xyz.erupt.annotation.fun.PowerHandler;
import xyz.erupt.annotation.fun.PowerObject;
import xyz.erupt.upms.service.EruptUserService;
import javax.annotation.Resource;
/**
* @author YuePeng
* date 2021/8/20 14:44
*/
@Component
public class SuperAdminPower implements PowerHandler {
@Resource
private EruptUserService eruptUserService;
@Override
public void handler(PowerObject power) {
if (eruptUserService.getCurrentEruptUser().getIsAdmin()) {
power.setDelete(true);
}
}
}