/// <summary> /// Initializes a new instance of the <see cref="GetCorporationsCorporationIdRolesHistory200Ok" /> class. /// </summary> /// <param name="changedAt">changed_at string (required).</param> /// <param name="characterId">The character whose roles are changed (required).</param> /// <param name="issuerId">ID of the character who issued this change (required).</param> /// <param name="newRoles">new_roles array (required).</param> /// <param name="oldRoles">old_roles array (required).</param> /// <param name="roleType">role_type string (required).</param> public GetCorporationsCorporationIdRolesHistory200Ok(DateTime?changedAt = default(DateTime?), int?characterId = default(int?), int?issuerId = default(int?), List <NewRolesEnum> newRoles = default(List <NewRolesEnum>), List <OldRolesEnum> oldRoles = default(List <OldRolesEnum>), RoleTypeEnum roleType = default(RoleTypeEnum)) { // to ensure "changedAt" is required (not null) if (changedAt == null) { throw new InvalidDataException("changedAt is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.ChangedAt = changedAt; } // to ensure "characterId" is required (not null) if (characterId == null) { throw new InvalidDataException("characterId is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.CharacterId = characterId; } // to ensure "issuerId" is required (not null) if (issuerId == null) { throw new InvalidDataException("issuerId is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.IssuerId = issuerId; } // to ensure "newRoles" is required (not null) if (newRoles == null) { throw new InvalidDataException("newRoles is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.NewRoles = newRoles; } // to ensure "oldRoles" is required (not null) if (oldRoles == null) { throw new InvalidDataException("oldRoles is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.OldRoles = oldRoles; } // to ensure "roleType" is required (not null) if (roleType == null) { throw new InvalidDataException("roleType is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.RoleType = roleType; } }
/// <summary> /// Initializes a new instance of the <see cref="GetCorporationsCorporationIdRolesHistory200Ok" /> class. /// </summary> /// <param name="ChangedAt">changed_at string (required).</param> /// <param name="CharacterId">The character whose roles are changed (required).</param> /// <param name="IssuerId">ID of the character who issued this change (required).</param> /// <param name="NewRoles">new_roles array (required).</param> /// <param name="OldRoles">old_roles array (required).</param> /// <param name="RoleType">role_type string (required).</param> public GetCorporationsCorporationIdRolesHistory200Ok(DateTime?ChangedAt = default(DateTime?), int?CharacterId = default(int?), int?IssuerId = default(int?), List <NewRolesEnum> NewRoles = default(List <NewRolesEnum>), List <OldRolesEnum> OldRoles = default(List <OldRolesEnum>), RoleTypeEnum RoleType = default(RoleTypeEnum)) { // to ensure "ChangedAt" is required (not null) if (ChangedAt == null) { throw new InvalidDataException("ChangedAt is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.ChangedAt = ChangedAt; } // to ensure "CharacterId" is required (not null) if (CharacterId == null) { throw new InvalidDataException("CharacterId is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.CharacterId = CharacterId; } // to ensure "IssuerId" is required (not null) if (IssuerId == null) { throw new InvalidDataException("IssuerId is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.IssuerId = IssuerId; } // to ensure "NewRoles" is required (not null) if (NewRoles == null) { throw new InvalidDataException("NewRoles is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.NewRoles = NewRoles; } // to ensure "OldRoles" is required (not null) if (OldRoles == null) { throw new InvalidDataException("OldRoles is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.OldRoles = OldRoles; } // to ensure "RoleType" is required (not null) if (RoleType == null) { throw new InvalidDataException("RoleType is a required property for GetCorporationsCorporationIdRolesHistory200Ok and cannot be null"); } else { this.RoleType = RoleType; } }
/// <summary> /// Create the web role coordinator. /// </summary> /// <param name="machineName">Specify the machineName if you would like to override the default machine name configuration.</param> /// <param name="purgeSites">Specify true to remove all sites before installing the tentacle</param> /// <param name="roleType">Specify type of role</param> public FarmRole(string machineName = null,bool purgeSites = false,RoleTypeEnum roleType = RoleTypeEnum.WebRole) { Log.Logger = AzureEnvironment.GetAzureLogger(); var config = AzureEnvironment.GetConfigSettings(); machineName = machineName ?? AzureEnvironment.GetMachineName(config); var octopusRepository = Infrastructure.OctopusDeploy.GetRepository(config); var processRunner = new ProcessRunner(); var registryEditor = new RegistryEditor(); _octopusDeploy = new Infrastructure.OctopusDeploy(machineName, config, octopusRepository, processRunner, registryEditor); _purgesites = purgeSites; _roleType = roleType; AzureEnvironment.RequestRecycleIfConfigSettingChanged(config); }
public ActionResult GetMenuesByRoleType(RoleTypeEnum roleType) { var rvm = CreateViewModel <RoleEditViewModel>(); var role_menues = _roleTypeRepository.FindById((int)roleType).Menues; var test1 = Enum.GetName(typeof(Menu), 17); var test2 = Thread.CurrentThread.CurrentCulture; rvm.Role.MenuItems = from m in EnumExtension.GetAllValues <Menu>() select new RoleMenuFoxsecAccessItem() { IsSelected = false, IsItemAvailable = (role_menues[(int)m] != 0 && CurrentUser.Get().Menues.IsAvailabe((int)m)) || (roleType == RoleTypeEnum.CM && m == Menu.ViewMyCompanyMenu) || (((int)m) >= 17), Text = (string)_resourceManager.GetObject(Enum.GetName(typeof(Menu), m), Thread.CurrentThread.CurrentCulture), Value = ((int)m) }; return(PartialView("MenuAccess", rvm)); }
public async Task <RoleDto> AddRole(string key, RoleTypeEnum roleType) { string uri = "api/role/addrole"; var request = new Rolerequest { Key = key, RoleTypeId = roleType }; var addRole = await httpServices.Post <RoleDto, Rolerequest>(uri, request); if (addRole == null) { throw new Exception(" Create role did not succesfull"); } return(addRole); }
public bool EditRole(long id, string key, RoleTypeEnum role) { bool flag = false; Role newRole; using (var db = new TimeTrackerModelContainer()) { newRole = db.Role.First(x => x.Id == id); newRole.Id = id; newRole.Key = key; newRole.RoleTypeId = role; db.Entry(newRole).State = EntityState.Modified; db.SaveChanges(); flag = true; } return(flag); }
public async Task <bool> EditRole(long id, string key, RoleTypeEnum roleType) { string uri = "api/role/editrole"; var request = new Rolerequest { Id = id, Key = key, RoleTypeId = roleType }; var editRole = await httpServices.Put(uri, request); if (editRole == false) { throw new Exception("Role edit did not succesful"); } return(editRole); }
public RequireRoleAttribute(RoleTypeEnum roleType) => _roleName = RoleFactory.GetRoleName(roleType);
public static string GetRoleName(RoleTypeEnum roleTypeEnum) => roleTypeEnum switch {
/// <summary> /// Is type || IsMod /// </summary> /// <param name="type"></param> /// <returns></returns> public static bool Is(RoleTypeEnum type) { return(AuthenticationSession.Is(type)); }
public IList <Role> Roles(RoleTypeEnum type = RoleTypeEnum.AdminRole) { return(_roleRepository.Table.Where(x => x.Active == true && x.Type == type).ToList()); }
//public static bool IsUser //{ // get // { // return AuthenticationSession.GetClaim(ClaimTypes.Role) == "User"; // } //} /// <summary> /// Is type || IsMod /// </summary> /// <param name="type"></param> /// <returns></returns> public static bool Is(RoleTypeEnum type) { return(IsAuthorized(type) || IsMod); }
//[XmlIgnore] //public bool RoleTypeSpecified { get { return RoleType != null; } } public Partner() { RoleType = RoleTypeEnum.MyRole; }
public RolePageAttribute(RoleTypeEnum roleType, string url) { Url = url; RoleType = roleType; }
public void SetRole(RoleTypeEnum type) { this.Role_Type_Id = (int)type; }
public MemberAssignmentService(DiscordSocketClient client, RoleTypeEnum roleTypeEnum) { _client = client; _roleName = RoleFactory.GetRoleName(roleTypeEnum); }
public static bool IsAuthorized(RoleTypeEnum type) { return(IsAuthenticated && AuthenticationManager.Role_Type_Id == (int)type); }