package com.lerx.v6.util;

import java.util.List;

import com.lerx.dao.iface.IAlbumPartnerDao;
import com.lerx.entities.Album;
import com.lerx.entities.AlbumPartner;

public class PartnerUtil {
	
	public static boolean basicPowerChk(long uid,Album album,IAlbumPartnerDao albumPartnerDaoImpl) {
		boolean con=false;
		if (uid>0L) {
			if (album.getLeader()!=null && album.getLeader().getId()==uid) {
				con=true;
			}
			
			if (!con) {
				List<AlbumPartner> lap= albumPartnerDaoImpl.queryByAid(album.getId());
				for (int i=0;i<lap.size();i++) {
					AlbumPartner partner = lap.get(i);
					if (partner.getUser().getId()==uid) {
						con=true;
						break;
					}
				}
			}
		}
		return con;
	}

}
