package info.bukova.isspst.services.users;

import info.bukova.isspst.data.Permission;
import info.bukova.isspst.services.AbstractService;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

public class PermissionServiceImpl extends AbstractService<Permission> implements PermissionService {

	@Override
	@Transactional
	public Permission getPermissionByModule(String moduleId, String permission) {
		return selectSingle("from Permission where MODULE = '" + moduleId + "' and AUTHORITY = '" + permission + "'");
	}

	@Override
	@Transactional
	public List<Permission> getAllPermissions() {
		return dao.getAll();
	}

}
