package performa.orm;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import oneit.objstore.FieldWriteability;
import performa.orm.types.JobStatus;
import performa.orm.types.RoleType;


public class CompanyUserHiringTeamLink extends BaseCompanyUserHiringTeamLink
{
    private static final long serialVersionUID = 0L;
    
    // This constructor should not be called
    public CompanyUserHiringTeamLink ()
    {
        // Do not add any code to this, always put it in initialiseNewObject
    }

    @Override
    public FieldWriteability getObjectWriteability() 
    {
//        if(getRole() == RoleType.OWNER)
//        {
//            return FieldWriteability.NOT_IN_GUI;
//        }
        
        return super.getObjectWriteability();
    }
    

    public boolean isOwner()
    {
        return getRole() != null && getRole() == RoleType.OWNER;
    }
    
    public List<RoleType> getAvailableRoles()
    {
        return Arrays.asList(new RoleType[]{RoleType.STANDARD, RoleType.ADMIN, RoleType.OWNER});
    }
}