Example #1
0
		internal void RegisterDestination(Destination destination, IService service) {
			_destinationServiceMap[destination.Id] = service.id;
			_destinations[destination.Id] = destination;
		}
Example #2
0
		/// <summary>
		/// Checks security for the given destination instance.
		/// </summary>
		/// <param name="destination">The destination that should process messages.</param>
		public void CheckSecurity(Destination destination) {
			if (destination == null)
				throw new FluorineException(__Res.GetString(__Res.Invalid_Destination, "null"));
			if (destination.DestinationDefinition != null) {
				string[] roles = destination.DestinationDefinition.GetRoles();
				if (roles != null) {
					bool authorized = DoAuthorization(roles);
					if (!authorized)
						throw new UnauthorizedAccessException(__Res.GetString(__Res.Security_AccessNotAllowed));
				}
			}
		}