package de.hsadmin.core.model;

import java.util.List;

import de.hsadmin.mods.user.UnixUser;

public class PrivilegesModuleImpl extends AbstractModuleImpl implements PrivilegesInterface {

	@Override
	public AbstractEntity add(AbstractEntity newEntity) throws HSAdminException {
		return super.add(newEntity);
	}

	@Override
	public List<AbstractEntity> search(
			Class<? extends AbstractEntity> entityClass, String condition,
			String orderBy) throws HSAdminException {
		return super.search(entityClass, condition, orderBy);
	}

	@Override
	public AbstractEntity update(AbstractEntity existingEntity)
			throws HSAdminException {
		return super.update(existingEntity);
	}

	@Override
	public void delete(AbstractEntity existingEntity) throws HSAdminException {
		super.delete(existingEntity);
	}

	@Override
	public boolean isAllowedToCreate(UnixUser user, AbstractEntity entity) {
		// stupid generic implementation allowing everything.
		return true;
	}

	@Override
	public boolean isAllowedToSearch(UnixUser user, AbstractEntity entity) {
		// stupid generic implementation allowing everything.
		return true;
	}

	@Override
	public boolean isAllowedToUpdate(UnixUser user,
			AbstractEntity orignalentity, AbstractEntity targetentity) {
		// stupid generic implementation allowing everything.
		return true;
	}

	@Override
	public boolean isAllowedToDelete(UnixUser user, AbstractEntity entity) {
		// stupid generic implementation allowing everything.
		return true;
	}

}
