public static CompUserRole create(string value, CompRole role) { if (value == null && role != 0) return new CompUserRole { Role = role }; else return FromString(value); }
public void setCompanyUserRoles(string compId, string email, CompRole role) { //pridani nebo aktualizace firemniho spravce. role==0 => vymazani refreshUserCompanyRelation(compId, email, (comp, user) => { if (role != 0) user.Roles.Role |= (role & ~nonCompAdminsRoles); else user.Roles.Role &= nonCompAdminsRoles; /*zachova pouze nonCompAdminsRoles*/ comp.Roles = user.Roles; }); }
public HumanEvalInfo[] HumanEvalatorInfos; //jazyky HumanEvalator role public override string ToString() { this.Role = this.Role & CompRole.All; return XmlUtils.ObjectToString(this); } //TODO ROLE
static bool checkRole(Container db, Int64 lmcomUserId, int companyId, CompRole role) { var r = db.CompanyUsers.Where(c => c.CompanyId == companyId && c.UserId == lmcomUserId).Select(c => c.Roles).FirstOrDefault(); return (r & (long)role) == (long)role; }